2018-10-22         Chad

Rspec multiple spec folders

Im currently building a project using Rspec in which I sepparated in two different folders with domain code and infrastructure code. Both folders have their own specs in a spec folder. The domain/spec folder is the one containing the spec_helper.rb file, thats required from the tests inside the other folder infrastructure/spec I'd like to know how to have a spec folder in the root of the project, including the spec_helper file and also tests, and being able to run all the tests with just one command (right now I do it running rspec domain/ infrastructure/) RSpec is desig...

 ruby                     1 answers                     49 view
 2018-10-22         Chad

Migration of Project Webcenter Portal Framework Application from JDeveloper11g to JDeveloper 12c

I decided to upgrade my existing JDeveloper to new version stated above in title, I found that my project got problem to run in the new JDeveloper. I found that some of the library used in oldest version cannot be reference. E.g. WebCenter Virtual Content Repository, Webcenter Page Service, WebCenter Collaboration Common, etcAlso, base on my finding from oracle, stated that "The WebCenter Portal Framework is not available in the WebCenter Portal 12c release."Can anyone please advice how should I work with my project by using the new JDeveloper. Any a...

 jdeveloper                     1 answers                     38 view
 2018-10-22         Chad

Keras Accuracy not changing for MNIST Dataset

I am new to Machine Learning and I was given the task of replicating the code from Binarized Neural Networks: Training Neural Networks with Weights andActivations Constrained to +1 or −1. I would like to implement it on Keras.I have written the code as shown below, however, the result obtained is stuck at 9.87%BNN.ipynbimport kerasfrom keras.models import Sequentialfrom keras.layers import Conv2D, MaxPooling2D,Dropout, Flatten, Densefrom keras.datasets import mnistfrom keras.layers import Dense, Activation, BatchNormalizationfrom keras.constraints import min_max_normfrom ke...

 python                     2 answers                     11 view
 2018-10-22         Chad

Pure CSS Radio Buttons show / hide a separate DIV layer

I want to have the user select a radio button to show a text field using pure CSS. I styled the radio buttons but I haven't been able to get them working. I'm sure it can be done, I think I am just not typing the CSS correctly. Can someone show me what I need to fix? <div class="grid-quote-full"><div id="PreviousSalesRep" class="grid-quote-full" style="display: none;"> </div> <label class="container">No | Non <input type="radio" checked="checked" name="radio" /> <span class="checkmark"></span> </label> <label class="...

 radio-button                     1 answers                     22 view
 2018-10-22         Chad

Executing popen with timeout

So am trying to execute Linux command specifically via subprocess.popen(). I want to wait only 30 secs for this command to execute because in certain scenarios my command hangs and program wait's forever.Below is the 2 approaches I used.Approach 1cmd = "google-chrome --headless --timeout=30000 --ignore-certificate-errors --print-to-pdf out.pdf https://www.google.com/process = subprocess.call(cmd, shell=True)process.wait() # Here I want to wait only till 30 secs and not untill process completesApproach 2from multiprocessing import Processp1 = Process(target=subprocess.ca...

 python-3.x                     1 answers                     86 view
 2018-10-22         Chad

How to use join() with groupby in pandas data frame so that the values can be separated using a separator

I am trying to group the data based on "customer no" and also I want to use a customized function that will separate the grouped values with a separator. I know I can use join(). However, I am not getting the result that I wanted. I am not sure how to modify the code to get the desired outcome. I am getting the grouped values with a separator even though I have used "," separator in my code.Desired outputThe code that I have used to do the operation.def f(x): return Series(dict(a = "{%s}" % ','.join(x['Date']), A = "{%s}" % ','.join(x['Flag-1']), ...

 python                     1 answers                     44 view
 2018-10-22         Chad

Convert 1st day string to Datetime

I'm looking for a way to be able to convert a date string like this:"1st Oct 2018" => 2018-10-01Or this:"10th Mar 2015" => 2015-03-10To it's equivalent string in the format yyyy mm dd. I have tried the following code, but no luck:DateTime dt = DateTime.ParseExact(stringDate, "yyyy mm dd", CultureInfo.InvariantCulture); Just in addition to great answer from Daisy:[TestCase("15th Oct 2018")][TestCase("1st Oct 2018")][TestCase("2nd Oct 2018")][TestCase("3rd Oct 2018")][TestCase("3d Oct 2018")]public void Action(string dateStr){ // Act var dt = DateTime.ParseExac...

 c#                     3 answers                     32 view
 2018-10-22         Chad

2 Different Outputs When Reversing Array

I am learning Javascript on a book and have to practice reversing an array by creating my own reverse function. The array must be reversed without creating a new variable to hold the reversed array. I thought I found a solution, but when I try to output my answer in 2 different ways (see below), I get different outputs:function reverseArrayInPlace(array) { for (var i = 0; i < array.length; i += 1) { array = array.slice(0, i).concat(array.pop()).concat(array.slice(i)); } console.log(array);}var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];Here are the outputs:reverseArra...

 javascript                     4 answers                     62 view
 2018-10-22         Chad

How to cut string of characters into a structure array [C]?

I implemented a program to cut string of characters (taken from the command line argument) into a structure of array. Yet, I am having some troubles running my program correctly. Precisely, I don't know what the output to expect or how to code the main function in order to check the program correctly.Input to the function is given in the following format: Age|Name;Age2|Name2;Age3|Name3for example, when I compile my program with -g -Wall -Wextra -Werror and run the program as follows./a.out "23|Marcin;"I get the following output:AWAVI��AUATL�%�21934Thanks for the help regard...

 c                     1 answers                     94 view
 2018-10-22         Chad

Not showing correct info PHP and Oracle query

My question is about an Oracle database which i can connect with PHP. With the same query using SQL Developer i've got this:But in PHP:$tsql= "select orden, fase, maquina_id, DescMaterial, dhsalida, scg_MaterialesLotes.lote, scg_MaterialesLotes.lotecli from scg_fases inner join scg_materiales on scg_fases.IdBoletin = scg_Materiales.IdBoletin inner join scg_MaterialesLotes on scg_Materiales.IdMatOf = scg_MaterialesLotes.IdMatOF";$stmt = sqlsrv_query( $conn, $tsql); if ( $stmt ) { ?> while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) { $orden = $row["...

 php                     1 answers                     80 view
 2018-10-22         Chad

Multiple Tablix Display in Report based on Parameter

I have designed a report that has Tablix called By Resource that displays data by a resource code and a second tablix called By Start Date that displays data by a start date.I've added a parameter called ReportSelection and gave it available values of:By ResourceBy Start DateIn the By Resource tablix, I selected Show or hide based on an expression and then set expression for hidden formula is: =IIF(Parameters!ReportSelection.Value="By Resource",TRUE,FALSE)However, when I run the report and select By Resource, the By Resource tablix doesn't show up. The By Start Date tablix...

 reportbuilder3.0                     1 answers                     92 view
 2018-10-22         Chad

How to create Transform in Memsql when source is Kafka Avro Format

I am able to push data from Kafka to Memsql. I am trying to push using Transform. I have created Kafka Consumer in Python which is consuming data from Kafka Topic and converting to Json Format.I don't know how to use this as Transform in Memsql. from confluent_kafka import KafkaErrorfrom confluent_kafka.avro import AvroConsumerfrom confluent_kafka.avro.serializer import SerializerErrorimport sysc = AvroConsumer({ 'bootstrap.servers': 'X.Y.Z.W:9092', 'group.id': 'groupid1112', 'schema.registry.url': 'http://X.Y.Z.W:8081', 'default.topic.config': { 'auto.of...

 python                     1 answers                     75 view
 2018-10-22         Chad

Calling .Complete or .DeadLetter on BrokeredMessage with Azure Functions ServiceBus triggered functions

I'm working with a Service Bus queue triggered function.When we manually (and crucially immediately) DeadLetter the BrokeredMessage, it does indeed go to the dead letter queue.However, the runtime reports the following error: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queueExample function:[FunctionName("MySbFunction")]public static async Task Run( [ServiceBusTrigger("topic-name", "subscription-name", AccessRights.Manage, Connection = "xxx")] BrokeredMessage msg, ILogger log){ await msg.DeadLetterAsync()...

 azure-functions                     1 answers                     97 view
 2018-10-22         Chad

Expand column with content from another url

I am using the following code in my own powerBI Data connector to get some date from a json document:{ "Customers": [ { "CustomerId": "8cd72f16-8d7b-48b0-90d9-71df011502c8", "CustomerTitle": "Test Customer", }}Code:GetCustomerTable = (url as text) as table => let source = Test.Feed(url & "/overview"), value = source[Customers], toTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"expandColumn" = Table.ExpandRecordColumn(toTable, "Column1", {"CustomerId", "CustomerTitle"}, {"Custom...

 json                     1 answers                     88 view
 2018-10-22         Chad

How to make variable available in parent shell after execution

Below is the simplified shell script a.sh :-function init(){ export aData="Data of a" echo "init of a"}function execute(){ init echo "execute of a >$aData<"}$@and this shell script is invoked by below alias :-alias ae="sh a.sh execute"executing ae gives below result :- init of a execute of a >Data of a<Once the execution is finished. Now accessing aData from the same terminal give no results :-echo $aDataprints nothing, even though aData is exported in the init method.Requirement is to have access to $aData after the execution of execute method of a...

 bash                     1 answers                     58 view
 2018-10-22         Chad

How to retrieve specific information from a list in python?

I have a file from which I would like to retrieve specific information.First, I extracted the lines of interest and I put them in a list:array = []file_in = open("Traj.pdb", "r") for line in file_in: if line.startswith('TITLE'): array.append(line)I end up with a list like this: ['TITLE Protein in INSANE! Membrane UpperLeaflet>POPC:POPE:CHOL=31.0:41.0:28.0 LowerLeaflet>POPC:POPE:CHOL=31.0:41.0:28.0 t= 1500000.00000\n', 'TITLE Protein in INSANE! Membrane UpperLeaflet>POPC:POPE:CHOL=31.0:41.0:28.0 LowerLeaflet>POPC:POPE:CHOL=31.0:41.0:28.0 t= 1500020.00...

 python                     2 answers                     93 view

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