Askar Ibragimov

0

votes
0

answer
8

views

StructureMap: how to report problems

Suppose I have an object that is itself declared as StructureMap registry but I forgot to add some dependencies to its list so the object cannot be built. For some reason, this does not manifest at all in any logs. How such debug information can be viewed?
Askar Ibragimov
1

votes
2

answer
589

views

SQL Server statements with IN clauses: how to make them faster?

I need to optimize the following query (table group_attributes) got columns group_id, attribute_id and int_value. select group_id from group_attributes where attribute_id= 1049 and int_value in (1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262,...
Askar Ibragimov
1

votes
1

answer
1.5k

views

Disable Checkboxes in JStree JQUery plugin

I have a jstree JQuery pluguin that I use with its 'checkbox' plugin. I need to select checkbox programmatically and disable checkboxes, also programmatically. How I can do that? https://groups.google.com/forum/?fromgroups#!topic/jstree/wLokkEg3eCY%5B1-25%5D this I tried ind got no result. My Jstree...
Askar Ibragimov
1

votes
3

answer
246

views

find element of particular class that happens before element with known ID, in jQuery

I have the following piece of HTML. Using jQuery it is easy to find the element with given ID ('ctl00_JQueryContent_PhenoTree_i1_ItemLabel' in the example). My task then to alter the SPAN right before it that has class 'rtUnchecked'. I further need to remove rtUnchecked and replace it with other CS...
Askar Ibragimov
1

votes
1

answer
175

views

Mocking service for Jasmine testing?

I am new to jasmine testing and I could not get a solid picture about how I could unittest my controller. My controller does some assignments and I basically want test to do the following: Mock service that it calls. Mock data in scope. Test the behaviour of the particular method in controller. Veri...
Askar Ibragimov
1

votes
1

answer
1k

views

405 Method not allowed in calling to WebAPI

I am calling using following request to a web service (copypaste from Chrome dev panel): Request URL:https://localhost:44300/api/userpreferences Request Method:POST Status Code:405 Method Not Allowed Request Headersview source Accept:application/json, text/plain, */* Accept-Encoding:gzip,deflate,sdc...
Askar Ibragimov
1

votes
1

answer
1.4k

views

Directive restricting input is not working with type=number

I have a custom directive that restricts input to specific symbols, in my case, only numbers. It is made after filters on ng-model in an input and it works fine in text-type inpit. Directive declared as .directive('onlydigitinput', function () { return { require: 'ngModel', link: function (scope, el...
1

votes
1

answer
23

views

How to get number of methods in angularjs service?

For Jasmine testing purposes, I want a test to fail if the number of methods in the service being tested is different from what is expected. That would tell the programmer that the test fixture is incomplete and that he must make more tests. How can I ask a service how many methods there are and, if...
Askar Ibragimov
1

votes
2

answer
146

views

Regex for random string plus optional dash and number

I would like to validate my string and would need help with regex. How do I express such a string: anything, then dash and some digits. Empty input should be ok too, if possible. so: [nothing] = valid astring = valid astring- = invalid astring-1 = valid astring-a = invalid astring-a1 = invalid
Askar Ibragimov
1

votes
1

answer
2.4k

views

Showing readable data in ui-grid with editable drop-down cell

I have a editable angular-ui-grid, where my editable column in columnDefs object is defined as columnDefs: [ { name: 'rightslist', displayNameKey: tr.rightsList, editableCellTemplate: 'ui-grid/dropdownEditor', editDropdownOptionsArray: [{name: 'Read-Only', value: 1}, {name: 'Read-Write', value: 2...
Askar Ibragimov
1

votes
3

answer
543

views

bootstrap and input-groups: how to make input wider wnen input-group-addon is hidden?

I have a code similar to original Bootstrap example: @example.com That will render this: According to my user story, sometimes I do not need that button on the right. If I attach to span with class 'input-group-addon' an angular expression such as ng-show='showButtonOnTheRight', and set that to fal...
Askar Ibragimov
1

votes
1

answer
248

views

Setting margin-left and width of an element to match margin and size of another element

I would like to make a menu effect such as on the example below, where HR tag is used to create sliding line effect under menu items. But in the example under the link the 'moving' hr is positioned using static settings (see the link for actual example): http://codepen.io/rm/pen/ldhon .two:hover ~ h...
Askar Ibragimov
1

votes
1

answer
180

views

How to produce “JSON diff” to be printed in js console?

In my angular project I often need to compare JSONs in my Karma/Jasmine tests and it would be really instrumental to have a console output of what was added and removed in comparison between 2 structures (e.g. these fields added, these changed values and these disappeared) The format of such output...
Askar Ibragimov
1

votes
1

answer
82

views

Using project files in NUnit tests

My program deals with input and output files and therefore need to have an access to a folder (included in Visual Studio Project) with existing files, and also create new files and check what's inside. Tests run on several machines, so absolute path is not an option. Also, I can not self-generate in...
Askar Ibragimov
1

votes
1

answer
699

views

Jackson JSON serializer: enable or disable serialisation of certain field in runtime?

I have trivial object serialization via Jackson library: ObjectMapper objectMapper = new ObjectMapper(); String jsonText = objectMapper.writeValueAsString(myComplexObject); I have one field in myComplexObject that I sometimes do not want to edn up in serialized result. I know that I can avoid seria...
Askar Ibragimov
1

votes
1

answer
814

views

Websocket STOMP (or REST) Controller in Spring: capture deserialization error?

I have a Spring Websocket Stomp controller that handles SEND messages (similarly to https://spring.io/guides/gs/messaging-stomp-websocket/) : @MessageMapping('/pong') public void handlePong(IncomingModel model) {...} It works fine if my IncomingModel can be deserializes behind-the-scenes correctly...
Askar Ibragimov
1

votes
1

answer
826

views

Make WebSocket sending non-blocking

Jetty uses org.eclipse.jetty.websocket.common.BlockingWriteCallback to send messages over websocket. If the client is 'slow' then this blocking write may experience hangs (see e.g. here https://github.com/eclipse/jetty.project/issues/272#issuecomment-290910610) I have a successfull simulation of slo...
Askar Ibragimov
1

votes
2

answer
55

views

Non-locking interaction with an array from several threads (in Java)

I would need an array of Strings to be accessed from two threads. It has to be very fast and thread-safe. I prefer not to use locks, what approach I can take to make lock-free thread-safe array of Strings? I need a recipe in Java.
Askar Ibragimov
1

votes
1

answer
169

views

Will ThreadPoolExecutor:: afterExecute return runnable in case of exception?

Javadoc for ThreadPoolExecutor defines (https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html#afterExecute(java.lang.Runnable,%20java.lang.Throwable)) protected void afterExecute(Runnable r, Throwable t) Will the initial runnable be passed to the function in the even...
Askar Ibragimov
1

votes
1

answer
99

views

Spring Integration, how to better describe validation component

My flow is defined like return IntegrationFlows.from( (MessageSourceSpec>) Files.inboundAdapter(directory) .autoCreateDirectory(false) .patternFilter('*.xml'), e -> e.poller(Pollers.fixedDelay(1000)) )) .transform(new TransformXmlToMyDocument()) .transform(new DataValidator()) // VALIDATOR .transf...
Askar Ibragimov
1

votes
1

answer
1.1k

views

Temporarily stop consuming RabbitMQ messages and resume later

I use Java's rabbitmq-client (https://mvnrepository.com/artifact/com.rabbitmq/amqp-client) and I need to implement the following scenario: While receiving Rabbit messages, I may need to pause Rabbitmq consumption from particular queues if I suspect that all awaiting data will not fit in memory. Aft...
Askar Ibragimov
1

votes
1

answer
1.3k

views

Need Dialog/Message Box component for C# ASP.NET

I would like to find a good-looking implementation of C# / ASP.NET message/simple dialog box. It should: be generated when I call something like showDialogBox() in my code, whenever I need to show it (simple C# interface) be modal. be visually appealing and customisable, including its size and posit...
Askar Ibragimov
1

votes
2

answer
1.3k

views

ExtJs 4 Store's AJAX proxy is not called on Store add — what is missing?

I have a Grid, a Store and Model for its data and AJAX proxy for the Store that is pointing to my self-written PHP back-end. The PHP backend writes to log each time it is called. The system works OK for Read, Update and Delete calls. However now I need to add new field to Store, which I do in such...
Askar Ibragimov
1

votes
2

answer
2.1k

views

Create batch file to copy contents of one SQL Server database to another

I need to create a batch file (script) to copy entire content of one SQL Server database to another. Source database is local for the machine. What command line tools and commands therein I could use? Destination database can be dropped entirely. Also, I need to run a pair of SQL queries afterwards,...
Askar Ibragimov
1

votes
1

answer
296

views

jquery tabs not updating cookie

I am using jquery UI 1.10 and I need to enable cookie in tabs. It used to work before. But despite getting lokely lates jquery cookies 1.31 (https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js) my tabs do not record a correct cookie. It does not change when I switch tabs. Tabs ar...
Askar Ibragimov
1

votes
2

answer
6.2k

views

Start file download by client from Javascript call in C#/ASP.NET page?

I need to initiate file download from ASP.NET page from javascript code. What would be my best option? Is it possible to call a webservice to do so, or somehow call usual event handler of C# page? Note that I will retrieve a large amount of data, many megabytes.
Askar Ibragimov
1

votes
1

answer
1.6k

views

How to set up cross platform compliation for C++ (NetBeans in win7 and make in linux)

I would like to set up a gcc C++ project using my preferred editro NetBeans (since it works with gcc), that would depend on some external libraries. I want it to compile in NetBeans with gcc chain, and in production - using command line make under linux. Preferably, first create project in NetBeans...
Askar Ibragimov
1

votes
2

answer
888

views

NHibernate - how get item with particular column value

Using NHibernate, I need to retrieve a row that matches particular criteria (like, ProjectId==1245). How I could do that, providing that I got ISession object and is able to query? How I do that if many rows are matching?
Askar Ibragimov
1

votes
2

answer
1.4k

views

bootstrap-angular modal dialog: can not return value from select

I have an angular-bootstrap modal dialog with the following template (jade syntax): div.modal-body select(ng-model='chosenProject' id='chosenProject', ng-options='c.value as c.name for c in selectItems') div.modal-footer button.btn.btn-primary(ng-click='ok()') Change project button.btn.btn-warni...
Askar Ibragimov
1

votes
2

answer
1.3k

views

Select particular item in SELECT drop-down using angularjs when initialized from object array

I have a code of SELECT element like this select(ng-model='chosenProject' id='chosenProject' ng-options='c.name for c in selectItems') where selectItems are arrays of objects, and each object got name and value fields. Later in chosenProject.value I read an object (with value and name fields) of ch...
Askar Ibragimov
1

votes
1

answer
38

views

How to find a d3.js plot element by its connected data?

I have a d3.js plot that is made from an array of objects, such as: svg.selectAll('.circ').data(dataArr) // dataArr is my array of objects .enter().append('circle') .attr('cy', function (d) { return d.y }) .attr('cx', function (d) { return d.x }) .attr('r', elemSize / 2) .on('dblclick', function (d,...
Askar Ibragimov
1

votes
1

answer
42

views

Modify CSS class contents only if it is situated under certain other class?

I have a particular CSS class that behaves OK in my layout but fails to do so if it is located under bootstrap's accordion class. After some adjustments it works ok within the accordion but then it breaks its appearance in other places. How it is best to define in CSS the following: Initially define...
Askar Ibragimov
1

votes
1

answer
160

views

Apache Camel: output route message to AMQP

I am a novice to Apache Camel and is looking for a way to direct output of a route to an AMQP. I could write a routine to send to AMQP myself, but I am looking for advice how it be done using Camel .to() when declaring a route? It is difficult to find a complete example online. what I need to do: c...
Askar Ibragimov
1

votes
1

answer
643

views

Split message into several (at least two) in Apache Camel

My Apache Camel's route at some point generates a list of objects. I have another route that expects one object as a message as well as certain object-specific headers and records it to database. What would be the best way to configure Camel route so that list is: split into individual objects as C...
Askar Ibragimov
1

votes
1

answer
2.8k

views

Self-Connect to Websocket Spring server from JUnit test

I have an app that exposes Websocket/SockJS/Stomp server endpoints and would like to run a JUnit tests that runs client (Java STOMP client, also from Spring) against it, to test 'sending' features. I have a test like public void measureSpeedWithWebsocket() throws Exception { final Waiter subscribe...
Askar Ibragimov
1

votes
1

answer
286

views

Spring Integration DSL: how to make single-threaded caching channel?

I have the following flow config: @Bean public IntegrationFlow setupDatabaseFlow() { return IntegrationFlows.from(pubSubDatabaseRabbitOutput) // WHAT CHANNEL .handle((p, h) -> databaseActivator.recordToDatabase(p, h)) .get(); } and I am willing to insert in 'WHAT CHANNEL' place some channel, that is...
Askar Ibragimov
1

votes
1

answer
360

views

Make Consul UI read-only

We use Consul and we are willing to enforce that developers can alter it only using git2consul approach, to retain the history of property changes and maintain a backup. In order to ensure that, we would like to make Consul Key-Value browser UI read-only. How could we achieve this?
Askar Ibragimov
1

votes
1

answer
274

views

Retrieving last record in each group from database with additional max() condition in MSSQL

This is a follow-up question to Retrieving last record in each group from database - SQL Server 2005/2008 In the answers, this example was provided to retrieve last record for a group of parameters (example below retrieves last updates for each value in computername): select t.* from t where t.last...
1

votes
2

answer
68

views

Is it correct to use an index that features INCLUDE of all columns?

While debugging a SQL query, SQL Server Dev Studio suggested that I have to create index like: CREATE INDEX IX_MY_INDEX ON T_EVENT (F_ORIGINAL_ID, F_EVENT_SEQUENCE_NO) INCLUDE (F_USER_ID, F_REVISION_NO, ... ) So, in INCLUDE it suggested to have a massive number of columns. While I do know that it...
Askar Ibragimov
1

votes
1

answer
49

views

Boost Spirit syntax for recognising series of numbers from a line into vector?

I have a string that comes in such flavours: SCALE FACTORS 16. 0.0 0.0 0.0 0.0 . or SCALE FACTORS 30. . . . . . or SCALE FACTORS 256. 10.0 20.0 30.0 . So, several numbers with dot at the end, and dots and spaces alon...
Askar Ibragimov

View additional