2018-10-22         Simon

Not Changing Header Text Color In Gridview through using CSS

I am using asp.net c#. I am using gridview to display the data. i am controlling all formating through CSS. In gridview i have define itemtemplate + edititemtemplate + footertemplate and doing sorting through bind column at template field. My problem is the column name which dispalay as header that color is not changed through CSS, font size,type all things going ok but fore color is fix as Blue is any body help me out how can i change forecolor of header which is allow to sorting.My code looks like :asp:TemplateField HeaderText="Slsmn No." HeaderStyle-CssClass="GridHeaderS...

 c#                     4 answers                     86 view
 2018-10-22         Simon

how to centre label in container bootstrap 4

Need help on getting the labels to centre in the container, please.I've added a URL link to the image because it's having issues uploading onto a website for some reason. I've also made the width 50% as I don't want them to take up the full width of the container which is fluid.I tried using text-center but when I changed the width to 50% the labels defaulted left. image<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymo...

 css                     4 answers                     59 view
 2018-10-22         Simon

How to add action menu on specific position

As per title. A new action menu is automatically added to the bottom of the list. Is there a way to force them to appear on specific index or just before/after a specific action ?Thanks in advance In Automation Steps screen, in Actions tab you can find the button REORDER ACTIONS, this may help you. [XXX]PXGraph class has an action collections declared as:public readonly PXActionCollection Actions;It is a class deriving from .Net framework OrderedDictionary.You can access it directly in your class deriving from PXGraph:this.ActionsIn the context of a graph extension de...

 acumatica                     2 answers                     11 view
 2018-10-22         Simon

Tensorflow adam optimizer in Keras

I have a net in Tensorflow and I am trying to reimplement it in Keras. Currently compared to the Tensorflow model the Keras model completly underperforms. The loss is much higher and decreases slower compared to the original model. My best guess is that I am using the wrong Optimizer. In the Tensorflow code the Optimizer looks like this:global_step = tf.Variable(0, trainable=False)learning_rate = tf.train.exponential_decay(0.0001, global_step, decay_steps=10000, ...

 python                     1 answers                     90 view
 2018-10-22         Simon

Angular 2: Ignore certain values in JSON object with *ngFor loop

I have the following JSON objects:{VarietyTypeName:"Greens", VarietyFamilyName:"Kale", VarietyName:"Red Russian"},{VarietyTypeName:"Greens", VarietyFamilyName:"Kale", VarietyName:"Starbor"},{VarietyTypeName:"Greens", VarietyFamilyName:"Lettuce", VarietyName:"Alkindus"},{VarietyTypeName:"Fruits", VarietyFamilyName:"Strawberry", VarietyName:"Jewel"}I'm using the following code to loop through the objects:<div *ngFor="let variety of varieties"> <div class="varietyTypeName menu-item-type-header"> {{variety.VarietyTypeName}} <i class="fa fa-angle-...

 angular                     1 answers                     21 view
 2018-10-22         Simon

converting individual characters in string to uppercase

my codename='helloworld' i=0 while(i<len(name)): name[i].upper() i=i+2 print(i)print(name)want the output as 'AnThRoPoMoRpHiSm'. Please help. You can enumerate your string and capitalize one of every 2 letters, then join the result:name='anthropomorphism'''.join([s if i%2 else s.upper() for i,s in enumerate(name)])This returns:'AnThRoPoMoRpHiSm' [XXX]

 python-3.x                     1 answers                     68 view
 2018-10-22         Simon

How to pre-process data before pandas.read_csv()

I have a slightly broken CSV file that I want to pre-process before reading it with pandas.read_csv(), i.e. do some search/replace on it.I tried to open the file and and do the pre-processing in a generator, that I then hand over to read_csv(): def in_stream(): with open("some.csv") as csvfile: for line in csvfile: l = re.sub(r'","',r',',line) yield l df = pd.read_csv(in_stream())Sadly, this just throws a ValueError: Invalid file path or buffer object type: <class 'generator'>Although, when looking at Panda's source, I'd expect it...

 python-3.x                     2 answers                     15 view
 2018-10-22         Simon

Django query case-insensitive list match

I have a list of names that I want to match case insensitive, is there a way to do it without using a loop like below?a = ['name1', 'name2', 'name3']result = any([Name.objects.filter(name__iexact=name) for name in a]) Unfortunatley, there are no __iin field lookup. But there is a iregex that might be useful, like so:result = Name.objects.filter(name__iregex=r'(name1|name2|name3)')or even:a = ['name1', 'name2', 'name3']result = Name.objects.filter(name__iregex=r'(' + '|'.join(a) + ')')Note that if a can contain characters that are special in a regex, you need to escape t...

 django                     6 answers                     8 view
 2018-10-22         Simon

How to convert between b'\\xe5' and b'\xe5' with python3?

How to convert between b'\\xe5' and b'\xe5' with python3?1.convert b'\\xe5' into b'\xe5'?2.convert b'\xe5' into b'\\xe5'? You can decode your bytes using the unicode_escape encoding, then convert the resulting string back to bytes by encoding it with latin1, which is a one to one encoding between bytes and characters: b'abc\\xe5\\xe6'.decode('unicode_escape').encode('latin1')# b'abc\xe5\xe6'And in the opposite direction:b'abc\xe5\xe6'.decode('latin-1').encode('unicode_escape')# b'abc\\xe5\\xe6' [XXX]

 python                     1 answers                     30 view
 2018-10-22         Simon

Consuming Web Service In MonoDroid Extremely Slow

Many other methods in web service are used throughout the app and work just fine. Only one method in particular is giving trouble. When the method is invoked directly from browser, result is pretty instantaneous, so the web service itself seems to be fine. But when a breakpoint is placed on the line where the service is consumed for this particular method, everything freezes for about 1.5 to 2 minutes. Switched to async version of method and stopped the app from freezing, but the results of the method are not in the SQL database for the same 1.5 to 2 minutes. This meth...

 android                     1 answers                     99 view
 2018-10-22         Simon

Select Total and If Read

I have the following tables:BookId Title 1 TestBookPage (BookId corresponds to Id from Book table)Id BookId Page1 1 11 1 2BookUserPage (BookPageId corresponds to Id from BookPage table)UserId BookPageId1 12 23 1My select query is as follows:SELECT B.[Id], B.[Title], BP.[Id], BP.[BookId], BP.[Page], COUNT(BUP.[BookpageId]) AS TotalFROM [Book] B LEFT OUTER JOIN [BookPage] BP ON BP.[BookId] = B.[Id] LEFT OUTER JOIN [BookUserPage] BUP ON BUP.[BookPageId] = BP.[Id]WHERE B.[Id] = 1GROUP BY B.[Id], B.[Title], BP.[Id], BP.[BookId], BP.[Page]The res...

 sql                     1 answers                     48 view
 2018-10-22         Simon

php against sql server 2005 is timing out

I'm running a php script from the command line against SQL server 2005 using the MS driver for PHP and getting time outs. The query takes about 2 minutes from SQL Server Management Studio and returns > 300,000 rows.There are multiple queries in the script and for each one I do a sqlsrv_connect(), execute the query and then sqlsrv_free_stmt() and sqlsrv_close()Output from sqlsrv_errors():Array( [0] => Array ( [0] => 08S01 [SQLSTATE] => 08S01 [1] => 258 [code] => 258 [2] => [Microsoft][SQL Nati...

 php                     2 answers                     58 view
 2018-10-22         Simon

Handling Repository and Kafka Transactions

I have a use case where I need to consume from a kafka topic, do some work ,produce to another kafka topic with only once semantics and save to a mongo database .After going through docs what I figure is that the kafka transaction and mongo transaction can be synchronized but they are still two different transactions .In the below scenario if the mongo commit fails is there a way to roll back the kafka record that was committed to the topic and replayed from consumer.producer.send()producer.sendOffsetsToTransaction()mongoDao.commit() If the listener throws an exceptio...

 spring-kafka                     1 answers                     43 view
 2018-10-22         Simon

Power BI - show data per month

I have two columns I'm trying to display. The first one is Close date and the other one is Open data. I need to count closed per month and opened per month and put them into a stacked chart. The issue is that close / open month are not the same. To explain it better, I have included a quick extract: CLOSE_DTTM OPEN_DT01/08/2018 24/05/201801/08/2018 31/05/201802/08/2018 12/07/201802/08/2018 12/07/201801/08/2018 26/07/201802/08/2018 28/07/201802/08/2018 29/07/201802/08/2018 31/07/201802/08/2018 31/07/201802/08/2018 01/08/2018What should I use for the axis in a s...

 powerbi                     1 answers                     62 view
 2018-10-22         Simon

Why git checkout after git clone?

I am new to git. I understand git basics as well as development procedures using git, however there is one thing that confuses me. Whenever I have to pull something from a git repo with multiple projects inside (example), I see these instruction steps:git clone xxxcd xxxgit checkout yyyThis is a bit puzzling to me. As I already have the entire repo, why would I want to checkout the project I am interested in if I can just copy the folder and do whatever I like with it? Note: I started this as a comment but it's long enough, and really can use some formatting, that I move...

 git                     2 answers                     32 view
 2018-10-22         Simon

Negative Binomial Loss in Neural Network using Tensorflow / Keras

I'm working with a highly skewed count dataset that's typically fit with a negative binomial. I want to use the negative binomial as a loss functions in Keras or Tensorflow on a feed forward neural network. To my knowledge, after looking through available loss functions, such a function doesn't exist for keras or tensorflow (although I'm hoping I'm wrong and I just missed something). I've looked around and I've seen posts suggest just swapping out the loss to include the negative binomial, but it appears there's more to creating a custom loss in tensorflow than just swappin...

 python                     1 answers                     71 view

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