Free Web Development Tutorials - Msn4Free.com

Logstash Multiline unnecessary fields @version , @timestamp, host, path under message 0

Logstash Multiline unnecessary fields @version , @timestamp, host, path under message

I am using logststash version 1.4.2

I have the following configuration

54c8cfb1bb62b1_

Without the multiline part the JSON notation of a a single line message looks like :

“message”: “[Hello] world”

,
After adding the multiline part

“message”: “{\”message\”:\”[Hello] world”, \”@version\”:\”1\”, \”@timestamp\”:\”2015-01-28T09:31:49.039Z\”, \”host\”:\”ip-10-50-20-23\”, \”path\”:\”/var/log/syslog\ “}”

As you see adding the multiline , changes the message attribute.
But the main problem is with multiline masseges.

54c8cfb1bb62b2_

As you can see on each line we have message: prefix and :”,”@version”:”1″,”@timestamp”:”2015-01-28T09:42:34.028Z”,”host”:”ip-10-50-20-23″,”path”:”/var/log/mintigo/online_platform.log”} suffix , this makes extermly hard to read the multiline message , does anyone have a solution for this problem ?

changing the position of control nav  in flexslider in a responsive website 0

changing the position of control nav in flexslider in a responsive website

im using flexslider on a responsive website (here : http://rastawood.com/home-fa.html ) and i needed to add some text to my slides.. so i changed the html structure of flexslider from this :

54c8cfb1bd41e1_

to something like this :

54c8cfb1bd41e2_

and its ok for all sizes except in mobile version (width between 350px and 639px) which i wanted the control nav bullets (red triangle things) to be placed under the slider images. to make layout like this:

slider image slider control nav bullets slider text

i tried absolute positioning for the bullets but it doesnt works in responsive because the height of the container changes in response to its width and if i try something like bottom:120px for the bullets they just go up and down in different sizes and maybe they come up on top of the image .. i think the html for these bullets is generated by js (which i know nothing about) and maybe if i findout where and how it is generated maybe i can place them somewhere else in mobile version by using display:none and display:block trick.
it works good when the bullets are under the textbox cuz its somehow on the flow of the page. but moving it under slider image and keeping consistency of it in different mobile sizes is the problem.

Read parameters from Java client in WPF application 0

Read parameters from Java client in WPF application

I have created WCF service in .net.

It is called by Java client, how do I read parameters when service is being called?

Here is my code:

54c8cfb1bec5b1_

Here is my WPF application code, I have added web reference:

54c8cfb1bec5b2_

How do I read values of “id” and “name” called from Java client?

I am stuck here, please help me please!!

Any help would be greatly appreciated.

Thanks!!

I need a solution for modal access with a Null field 0

I need a solution for modal access with a Null field

In my MVC project i am using a model class , in that class i want a dummy value . i am using that class as a list type

54c8cfb1c03bd1_

in this i am using as list type. i need a another field also but while inserting i dont want that field to get in to my entity fram work. that feild is not in database but i want to show in list . while adding i dont want. for example

54c8cfb1c03bd2_

T SQL: Inner join in sub select query? 0

T SQL: Inner join in sub select query?

I’m a WPF developer not a sql dba… Trying to do a join in a sub select. I have two tables: tbArticles & tbRegions. TbArticles holds a regionCode column which is also common to tbRegions. I’m trying to get a count of all articles by region and country:

enter image description here

enter image description here

This is the result I’m looking for:

enter image description here

I’ve managed to get the countrys by region from an inner join:

54c8cfb1c18531_

But how do I get the result I want with the join as a sub select? I’ve tried this sort of thing but obviously it’s not right.

54c8cfb1c18532_

Singleton application with vector member 0

Singleton application with vector member

I have a Singleton application server (assume being created correctly). The server class has a non static vector member which is modified in several methods. Is it possible that the compiler optimizes the code such that the vector is modified non serially across several request processing method chains. I mean can two chains of method calls may intersect across different requests ?
I think they can because the method calls would be jumps to labels .

How to mock.patch a plain dictionary in python? 0

How to mock.patch a plain dictionary in python?

How do I mock.patch a plain dictionary {} ?

I would like to check if the headers is set to {‘Content-Type': ‘application/json’}.

54c8cfb1c562c1_

The following unit test seems to successfully patch dict. But I have a {}, which I need to patch.

54c8cfb1c562c2_

I suppose an alternative way would be to mock patch def get(self): result = Spider.get_news_urls() for k, v in result.iteritems(): response = requests.get(v) xml = response.text() headers = {'Content-Type': 'application/json'} data = '' taskqueue.Task(url='/v1/worker', headers=headers, payload=json.dumps(data)).add(queue_name='itagnewstasks') return 'success', 200 and compare if it was called with @mock.patch('__builtin__.dict') @mock.patch('requests.get') def test_header_is_set_to_json(self, req_get, x): gen = Generator() gen.get() x.assert_called_with() as a parameter.