2018-10-22         Xavier

How to write handlebars if condition for title text

I am trying to show on pagination buttons title="text", I got to show on the button when I hover the link to page from some pagesBut, how can I implement title text to the current Page?Here is my code:<li class="files-overview__pagination-item{{#is data.root.currentPage hash.pageNr}} is-active{{/is}}"><a class="files-overview__pagination-link" data-js-item="files-overview__pagination-item" data-pagination-page="{{hash.pageNr}}" title=" {{data.root.currentPage hash.pageNr}} current page}} jump to page {{hash.pageName}} of {{data.root.totalPages}}" > ...

 handlebars.js                     1 answers                     36 view
 2018-10-22         Xavier

React ActionCable Provider createConsumer function not working?

I am building an application and decided to utilize ActionCable for websockets. My goal is to keep track of each user in Actioncable so when they unsubscribe/close the window, I can remove them from a running list. There is no issue when the users join and I push them into the list; however, I cannot seem to establish a connection that allows me to set up the current_user attribute. Here is the error that is displaying. ActionCable createConsumer is not a functionHere is the code where I am trying to implement it. import { ActionCableProvider, ActionCable } from 'react-acti...

 ruby-on-rails                     1 answers                     79 view
 2018-10-22         Xavier

Rails How to set multiple polymorphic in controller?

Rails How to set multiple polymorphic in controller?Some of codes as follows:question.rbhas_many :comments, :as => :commentable, :dependent => :destroycomment.rbbelongs_to :commentable, polymorphic: truehas_many :reports, :as => :reportable, :dependent => :destroyreport.rbbelongs_to :reportable, polymorphic: trueroutes.rbresources :questions do resources :comments do resources :reportsendAnd then in _comment.html.erb:<%= link_to "<i class='fa fa-times mr2 fa-fw'></i>Report".html_safe,new_question_comment_report_path(@question,@comment),remote...

 ruby-on-rails                     2 answers                     0 view
 2018-10-22         Xavier

Disabling special treatment of an "unstable" application on Windows 7

I do remember that Windows 7 have some technology that marks applications that crashed a few times and later executes them with more robust and slow system runtimes. It is possible to disable this feature or edit the list, but I cannot figure out how.I would be grateful for any right keywords or links.Note: It has nothing to do with DEP or UAC.P.S. I tried to google it for more than an hour, but I can't find anything related. Finally got the answer myself - that is Fault Tolerant Heap :https://msdn.microsoft.com/en-us/library/windows/desktop/dd744764%28v=vs.85%29.aspx ...

 windows                     1 answers                     60 view
 2018-10-22         Xavier

Append file name using CSV

I'm trying to rename files that match values in column one of a csv adding the value in column 3 to the beginning of the file name leaving the rest of the file name intact. Here is what I have so far. I cant seem to figure out the Rename-Item. # Common Paths$PathRoot = "C:\Temp\somefiles" #Where the files are to rename# Get csv file$ClientAccounts = Import-CSV -path "\\server\some\path\to\csv\file.csv"# Get each file and rename itForEach($row in $ClientAccounts) { $CurrentClientTaxId = $row[-1].TaxId $CurrentClientName = $row[-1].ClientName #loop through files ...

 powershell                     1 answers                     1 view
 2018-10-22         Xavier

How to run Javascript files independent of HTML

I'm a super newb with Javascript...How can I run a .js file without using code in HTML? I also needs the ability to run JQuery (ajax command) which is in the .js file.I'm trying to test to find out exactly what is being returned from an Ajax command which runs a query on an Elasticsearch server.Here is my code of which I'd like to see exactly what is being pulled:var load_data = function() { $.ajax({ url: 'http://localhost:9200/inventory/_search?pretty=true' , type: 'POST' , data : JSON.stringify( { "query" : {...

 javascript                     2 answers                     16 view
 2018-10-22         Xavier

Is there a way of sharing a Core Data store between processes?

What am I trying to do?A UI process that reads data from a Core Data store on disk. It wouldn't need to edit the data, just read and display the data.A command line process that writes to the same data store as accessed by the UI. Why?So that the command line process can be running all the time but the user can quit the UI process and forget about the app until they need to look at the data it's captured.What would be the simplest and most reliable way of achieving this?What Have I Tried?I've read up on sharing a data store between threads and implemented this once before, ...

 objective-c                     4 answers                     79 view
 2018-10-22         Xavier

BST conversion to the tree of symmetric structure

(I've seen some very similiar excercises, but all of them for a regular binary trees). As in the title I have to propose an algorithm to convert BST to another BST with symmetric structure, which includes the same values as the previous one. For example My idea was to build a new tree from the beggining. I would start with a new root that would be in a symmetric position of the original one in a sorted array of values from the original tree. In the example above: 3 5 6 7 12 number 7 will be the new root, because it has reversed number of nodes at its left/right side in com...

 algorithm                     1 answers                     76 view
 2018-10-22         Xavier

Datawindow sharedata for multiple data window

Is it possible to share the data of 2 data window into 1 data window? How? And if not, is there any other way to pass the data of 2 datawindow into 1 data window? In short, no. Sharedata works only from a single source. If multiple source datawindows have the same column types you can use the Rowscopy method and copy many sources into a single destination datawindow. [XXX]An alternative method is to go back to the 'SELECT' statement ans work with SQL UNION. For example, fi you have the following SQL statements for your 2 dw:SELECT a,b,c from table1SELECT d,e,f from...

 xml                     2 answers                     27 view
 2018-10-22         Xavier

Spring Integration: TaskExecutor and MaxConcurrentConsumers on AmqpInboundChannelAdapter

My Spring Integration app consumes messages from RabbitMQ transforms them to SOAP message and does web service request. It is possible to get many (10 – 50) messages per second from the queue.Or after application restart there could be many thousand messages in RabbitMQ queue.What is the best possible scenario to process up to 10 messages in parallel threads (message ordering is nice to have but not required feature, if web service answers with business failure then failed message should go to retry until it succeeds).Amqp listener should not consume more messages from the ...

 spring                     1 answers                     37 view
 2018-10-22         Xavier

sql want to count one column only if another column is ok

I have a db like this:id name job payment1 susan job1 no2 rob job2 no3 mike job3 yes4 bob job2 yesI need to get the number of persons group by job, but only if they have yes in the payment.I have done something like this:SELECT job, count(*) AS job FROM database GROUP BY jobThe result is the count of persons with the same job, but I don't know how to check the other column (payment) and only if it is "yes" make the count.Hope you can help me, thanks You could use SUM and condition:SELECT job, SUM(payment = 'yes') AS job_cntFROM databaseGROUP BY ...

 mysql                     2 answers                     47 view
 2018-10-22         Xavier

Creating a CHANGE script in Management Studio?

I was wondering if there is a way to automatically append to a script file all the changes I am making to my columns, tables, relationships etc...The thing is I am doing a lot of different changes on a TEST db and the idea will be to apply this change script when I move the test db to production... hence keeping production data but applying all schema and object changes.Is there an easy way to do this? Can it also migrate database diagram changes?I have seen how you can create a change script each time I do a change but this means I have to copy and paste into a master file...

 sql                     6 answers                     72 view
 2018-10-22         Xavier

How to display error message generated from raiserror() with SQL Server

I am interacting with SQL Server 2005 from a jsp via JDBC (this is an assignment not a real project) and I have created a trigger in the database I am using. If a certain condition is not met when this trigger executes I raise an error via raiserror(). I would like this error to be displayed on the actual page that calls the SQL Server query via JDBC, but currently I am just getting the following default message when I print out the result of SQLException.getMessage():The transaction ended in the trigger. The batch has been aborted.Does anyone know how to extract the text I...

 sql-server                     2 answers                     97 view
 2018-10-22         Xavier

Why is Android O failing with "does not belong to this FragmentManager!"

I have migrated my application to Android O in Android Studio 3Running on an Android O emulator all my dialogFragments now fail with :-java.lang.IllegalStateException: Fragment MyDialogFragment{43ccf50 #2 MyDialogFragment} declared target fragment SettingsFragment{ceed549 #0 id=0x7f0f0142 android:switcher:2131689794:0} that does not belong to this FragmentManager!at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1316)at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1624)at android.support.v4.app.Fra...

 android                     5 answers                     37 view
 2018-10-22         Xavier

Running multiple independent apps with different frameworks (.NET and Flask) on same Azure web app service

I have a website <my-website-name>.azurewebsites.net. This site is going to hold multiple small apps that are developed on different frameworks, something like this:<my-website-name>.azurewebsites.net/app1 : Developed in Python Flask<my-website-name>.azurewebsites.net/app2 : Developed in C# .NET<my-website-name>.azurewebsites.net/ : Developed in C# .NETThe problem is I can not keep all of them up and running (please see attached pic)! Snapshot of my azure portal when I have 3 applications with different frameworks on same web app serviceWhen python i...

 c#                     1 answers                     30 view
 2018-10-22         Xavier

Swift 4 Xcode 9 Take Screenshots of a View and Save them

I'm trying to put a Button into my App which should take a Screenshot of a View.I tried different things, but nothing worked (Always got "Thread 1: Signal SIGABRT" as error) I make a little extension of UIImage with option to transform UIView into UIImage and then to scale image in exactly size that you need. Now you can just init your UIImage with your view line var image = UIImage(view:myView)extension UIImage { func imageWithImage(scaledToSize newSize:CGSize) -> UIImage?{ UIGraphicsBeginImageContextWithOptions(newSize, false, 0.0); self.draw(in: CG...

 ios                     1 answers                     95 view

Page 1 of 144  |  Show More Pages:  Top Prev Next Last