text:
Q: devise authentication via ruby script I have small application, and I will have some external applications put data to this service over http with rest. I already have it working but without authentication. In portal I use devise, and my question is: how to (example desired) authenticate to portal from ruby script level? What to add to following script to authenticate first? I want to protect this controller with devise and then I need authentication part to following script.
require "net/http"
require "json"

@host = "localhost"
@port = 3000
@post_ws = "/external/rd"

@req_body = {
"device" => {
  "name" => "device_json",
  "operating_system_id" => "7",
  "hash_string" => "jfsg3k4ovj0j02jv",
  "user_id" => "1"
}
}.to_json

req = Net::HTTP::Post.new(@post_ws, initheader = {'Content-Type' =>'application/json'})
req.body = @req_body
response = Net::HTTP.new(@host, @port).start {|http| http.request(req) }

Regards,
Mateusz

A: Here is solution:
I used token_authenticatable from devise.
Here is one great answer how to implement it with json. I had some trouble and described them in this question. There is also answer.
Here goes example code:
require "net/http"
require "json"

@host = "localhost"
@port = 3000
@post_sign = "/users/sign_in.json"
@post_ws = "/external/rd"

@req_sign = {
"user" => {
  "email" => "some@email.com",
  "password" => "123456"
}
}.to_json

sig = Net::HTTP::Post.new(@post_sign, initheader = {'Content-Type' => 'application/json'})
sig.body = @req_sign

http = Net::HTTP.new(@host, @port).start
resp1 = http.request(sig)
puts "Response: #{resp1.code} , Message: #{resp1.message} , Body: #{resp1.body}"

if resp1.code == "200" then
  puts "logged in"
  json_resp = JSON.parse(resp1.body)
  @auth_token = json_resp['auth_token']

  @req_body = {
  "device" => {
    "name" => "device_json",
    "operating_system_id" => "7",
    "hash_string" => "jfsg3k4ovj0j02jv"
  },
  "auth_token" => @auth_token
  }.to_json
  req = Net::HTTP::Post.new(@post_ws, initheader = {'Content-Type' =>'application/json'})
  req.body = @req_body

  response = http.request(req)
  puts "Response: #{response.code} , Message: #{response.message} , Body: #{response.body}"
end

Regards,
Mateusz


As I mentioned in my last blog, the organisation gathers and records information from a wide range of locations directly from members of the public. Once you add this to what officers on the team experience/see when they are out and about and the information that we receive from our various partner agencies, we often find ourselves in a situation where we have more issues to deal with than time or resources allow. As well as this information, there are a number of competing tasks which the team members have to deal with. Dealing with allocated investigations and suspects, managing ongoing partnership work, dealing with persistent and/or problematic individuals, conducting engagement activities and conducting training/ continuing professional development is all part of my staff's day job. This is not an exclusive list, but one of the parts of the job that I enjoy the most is that no two days are the same! Often the team have competing demands on their time, many of which are urgent and appropriate for us to deal with, so the question then arises of how we decide which task is the most important.
Sometimes the decision is easy to make; for example incidents which are ongoing with a risk to the people involved, clearly comes at the top of the list - after all, that's why we have flashing lights and sirens on our cars! There are also clear legal guidelines about dealing with people in the cell block promptly and efficiently and the Custody Sergeant makes sure that this happens.
These are the easy examples. The hard part comes from deciding between equally important incidents or issues, and this is where the challenge arises.
Every two weeks, we meet as a city centre team and discuss the ongoing issues and trends in our area, both in terms of the people and the places that we cover. The team reviews the information that we receive and risks within the city centre that are presented to us. Using this information we discuss the relevant competing demands and the guiding principles of these discussions are, as with most of the decisions that the team make, Threat, Risk and Harm.
The higher the level of Threat, Risk, or Harm, an incident or individual ranks the more pressing dealing with the issue becomes. So the team debates the various highlighted concerns and what action, if any we should take in the matter. Once we have a clear picture of what work we need to do over the next fortnight, then we prioritise the work. As well as identifying key tasks that need to be carried out, we also highlight two locations and two individuals which become the focus of our work for the next fortnight. This means that we are able to effectively plan the workload of the next two weeks work for the team and officers can be held to account on the tasks that they are set and the two week cycle starts again.
As always, the key element to this is the information that we are able to gather from the public in its various forms. So whilst at times it might seem a thankless task to tell the police things, the information you give us is key to our ongoing prioritising of issues.


text:
Following its Commercial Success in Jordan
Jordanian documentary film 17 by director Widad Shafakoj is competing in the 11th Oran International Arabic Film Festival, which will be held from 25 to 31 July, only days following the film's commercial success after its release at Prime Cinema, Baraka Mall in Jordan.
The festival will feature 30 films, including 10 feature films, 10 short films and 10 documentaries competing for its awards. The festival will also offer workshops for young people interested in cinema on different topics, such as the visual effects, short filmmaking. Furthermore, the festival will honor the late great Egyptian actress Shadia and the late Algerian director Farouk Beloufa.
The film screened at several prestigious film festivals around the world, including the Carthage Film Festival (JCC) in Tunisia, the 1st El Gouna Film Festival, Muscat International Film Festival, ALFILM - Arab Film Festival Berlin, Arab Women Film Festival in Sweden, Arab Film Festival in California, USA, Arabisches Film Festival Tübingen in Germany, the Franco Arab Film Festival in Jordan and the Film Market at Dubai International Film Festival (DIFF).
17 follows the Jordanian under-17 women's football team as they prepare for the FIFA U17 Women's World Cup Jordan 2016. Coming from different backgrounds, each of the girls has faced a different set of challenges as a national team player. But now they come together to face their biggest challenge yet.
The film is a social exploration into the lives of young women who are passionate about a sport they have been told was only for men. Will Anoud make it in the final squad? Will Leen be ready to play in this world-class event with so little time to prepare? Will the odds finally start working for the team? 17 is directed by Widad Shafakoj, produced by Muna Fityani and distributed in the Arab world by MAD Solutions.
Widad Shafakoj is a Jordanian documentary film director who utilizes films as a means of expressing her opinions on the society in which she lives. She directed ID:000, an award-winning short film about the abuse that is inflicted on Jordanian orphans. The film led to a change in Jordanian orphan-related regulations.
In 2013, Shafakoj directed The Last Passenger, another short film that exposed the story of Syrian refugees who illegally escaped from Al Zaatari Camp to Jordanian governorates. A year later, Widad was able to present an issue that is close to her heart in her debut feature film If You Meant to Kill Me, which follows women who are imprisoned for their protection after being threatened to get killed for honor.
In 2017, Widad worked with HRH Prince Ali bin Hussein on her film 17, which follows the Jordanian under-17 women's football team as they prepare for the FIFA U17 Women's World Cup Jordan 2016.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Android Instrumented test Dialog not showing when run all tests I'm having an issue with instrumented Android Tests.
I have an app which shows a dialog informing the user that a server connection is established.
I created the tests using Espresso and when I run the tests as single tests everything works fine, the dialog pops up.
But when I run the all tests only the first test shows the pop up dialog, all other test classes fails to show the dialog.
Maybe it is an timing issue, but I cannot figure out, why it always succeed on the first test and fails on all folling tests
Any ideas?

redpajama_set_name: RedPajamaStackExchange


The 8-cylinder, in-line, valve-in-head engines used in Series 40-50 and Series 70 are of the same general design and external appearance, differing principally in bore and stroke, power, and dimensions of parts. The bore, stroke, piston displacement, compression ratio and horsepower of all engines are given under Engine General Specifications (par. 2-2).
The smaller engine used in Series 40-50, designated "F 263," differs from the larger engine used in Series 70 in having all crankshaft bearings of the same diameter from front to rear. It also differs from the larger engine in having the piston pins offset 1/16″ and the crankshaft offset 1/8″ toward the camshaft side from the centerline of the cylinder bores.
All Dynaflow engines use hydraulic valve lifters which do not require valve lash adjustment.
Series 50 synchromesh engines use hydraulic valve lifters.
Series 40 synchromesh engines use plain sleeve valve lifters with adjustable valve lash.
All synchromesh engines use a thick Steelbestos cylinder head gasket; all Dynaflow engines use a thin steel gasket to provide a higher compression ratio.
Synchromesh engine crankshafts, flywheels, and flywheel housings are different from the Dynaflow engine parts (see par. 2-5 d).
Series 70 engines do not have any variations since only the Dynaflow transmission is used in this series. These engines are equipped with hydraulic valve lifters.
When one or more bores in a cylinder crankcase cannot be properly finished to the nominal size, all bores are finished to .010″ oversize and are fitted with a .010″ oversize pistons and rings. This practice is quite general in the automotive industry and engines having such cylinder crankcases are not to be considered as special or other than production standard. These engines are identified for service purposes by a dash mark about 1/4″ long stamped directly following the engine number.
The Series 70 engine, and the Series 40-50 engines used with synchromesh transmissions have steelbestos cylinder head gaskets approximately .050″ thick, Series 40-50 engines used with Dynaflow Drive have sheet steel gaskets – .015″ thick. To insure a tight seal, the steel gasket is crimped around the edges of all openings where leakage may occur.
Pistons are Anodized aluminum alloy. All pistons have full skirts, are cam ground, and have four piston rings above the piston pin, Series 40-50 aluminum pistons have two transverse slots in bottom ring groove; Series 70 pistons have slots in skirt below bottom ring groove. All Series 40-50 pistons have the pins offset 1/16″ toward camshaft side; Series 70 pins are on centerline of piston. See figure 2-4.
The compression rings in the two upper grooves of piston are distinguished by a small groove (on some rings a bevel) cut around the inner edge on one side. This groove (or bevel), which must be on top side of ring when installed, permits the ring to warp very slightly in the groove so that only the lower outer edge contacts the cylinder wall to aid in controlling oil during light duty operation. Under heavy duty operation the force of explosion flattens the ring and pushes it outward to provide heavier contact with the cylinder wall and insure an effective compression seal. See figure 2-5.
The ring used in the fourth groove from top of piston is designated as the "Flex-Fit" oil ring. The name was derived from the shape of the ring and its extreme flexibility. The ring is made from strip steel and is composed of segments which are joined at the inner edge of ring and separated by narrow slots in the wiping edges. This flexible construction permits perfect contact between the piston ring and the cylinder wall. Oil passing through the inner slots returns to the crankcase through holes drilled in the piston in Series 70, or through the transverse slots in Series 40-50.
Connecting rods are heat-treated steel drop forgings of 1-beam section. Rods are forged with sufficient metal on bosses at both ends so that metal can be removed as required to secure correct weight and balance during manufacture.
The crankshaft is supported in the cylinder crankcase by five bearings. In Series 70 engines the crankshaft journals and the bearings are stepped up in diameter, from front to rear. In Series 40-50 engines the journals and bearings are the same diameter from front to rear.
A flywheel type harmonic balancer is mounted on the front end of crankshaft to dampen torsional vibration. The hub of the balancer is keyed to the crankshaft and retained by a clamp bolt threaded into the end of crankshaft. A pulley incorporated in the balancer assembly drives the fan, water pump, and generator through a belt.
The valve lifters operate in guide holes reamed in crankcase above the camshaft. Series 40 synchromesh engines use plain sleeve type valve lifters, and the ball studs in rocker arms are used to adjust valve lash to specified limits to insure full seating and quiet operation of valves. Series 40 Dynaflow and all Series 50-70 engines use the self-adjusting hydraulic valve lifters described in subparagraph f below.
Inlet valves have streamlined heads and exhaust valves have mushroom heads, all ground for 45 degree seats in cylinder head. Each valve is closed by two coil springs.
In operation, the plunger and lower chamber are kept filled with oil, being supplied through passages in the rocker arm shaft, rocker arm, ball stud, push rod ends, and the push rod seat in lifter. The tubular push rod serves as a reservoir to maintain a head of oil above the lifter.
When the valve lifter is on the camshaft base circle (off the cam) the spring raises the plunger to eliminate all lash clearances between parts in the valve train. If the lower chamber is not completely filled with oil at this time, oil will run down through the feed hole past the check valve ball to fill the chamber.
As the rotating camshaft raises the lifter body the pressure created in the lower chamber closes the check valve so that the plunger and push rod seat move with the body. This movement is transmitted to the push rod, rocker arm, and valve without lost motion. During the lifting movement any oil that leaks past the plunger returns to plunger or passes out of the body through grooves and holes in these parts. When the parts in valve train expand du e to heat, the volume of oil in lower chamber of lifter is automatically adjusted through the check valve to compensate for these changes and maintain zero valve lash.
The engine lubrication system is of the force-feed type in which oil is supplied under full pressure to crankshaft, connecting rod, and camshaft bearings, and is supplied under controlled volume to the rocker arm bearings, push rods, and valve lifters. All other moving parts are lubricated by gravity flow or splash. See figure 2-8.
The supply of oil is carried in the lower crankcase, which is filled through the opening in the rocker arm cover. The filler opening is covered by a combination filler and ventilating cap which contains filtering material to exclude dust. A removable oil gauge rod on right side of crankcase is provided for checking oil level.
Oil in lower crankcase is picked up and circulated by a gear type oil pump. The oil pump inlet is equipped with a floating screen which is hinged so that it follows the oil level under all conditions, thus drawing clean oil from near the top above any sediment which might collect at bottom of crankcase. See figure 2-8. Should the oil pump screen become clogged due to abnormally thick oil, sludge, or other cause, suction of the pump will ca u se the screen to collapse at its center and open a valve that will permit oil to be drawn into the pump.
The oil pump is driven by the distributor shaft which is driven from the camshaft through spiral gears. It contains two helical gears enclosed in the pump body and retained by the oil pump cover, to which the floating oil pump screen is attached. The oil pump body contains a non-adjustable spring loaded pressure valve, which regulates the oil pressure at 3G pounds at 35 MPH under normal operation.
Oil under pressure l eaves the pump through a drilled passage in pump body, which connects to the main oil gallery in the right side of crankcase. Branch passages in the crankcase distribute oil from the oil gallery to the camshaft and crankshaft bearings. Holes drilled in the crankshaft carry oil to the connecting rod bearings.
All oil supplied to the overhead valve mechanism is filtered by passing it through an AC oil filter containing a folder paper low-restriction element. The oil filter is mounted on a bracket attached to thermostat housing above the water pump. The inlet side of filter is connected by a pipe to the main oil gallery in right side of crankcase. The outlet side of filter is connected by a pipe to a drilled passage in cylinder head. The filter contains a valve which will open at 7-9 pounds pressure to by-pass oil to the outlet in case the filter element becomes plugged or otherwise inoperative.
A small hole in each rocker arm feeds a slight amount of oil to the contact point between the arm and the valve stem. Another passage conducts oil to the ball stud, where it connects with a groove and oil holes in stud through which oil is fed to the push rod. See figure 2-6. On all engines having hydraulic valve lifters, the push rod ends have holes through which oil is fed into the push rods and down into the valve lifters.
On Series 40 having adjustable valve lash the hole in push rod upper end is eliminated so that oil does not enter the push rod. The rod end socket is deeper to form a shroud that prevents oil from spraying over valve stems. These rod ends are copper finished for identification. To reduce rocker arm shaft oil pressure, the oil inlet pipe is reduced in size to fit loosely in No. 1 bracket oil hole and thus permit oil to bleed out at this point. A baffle is located above the loose joint to direct surplus oil downward and away from valve stems.
The outlet pipe is connected to the push rod cover, and extends rearward at a low level on right side of engine. Suction created by air passing the open end of the outlet pipe, when car is moving forward, causes air to be drawn into the rocker arm cover through a ventilating type oil filler cap which contains a gauze filtering element. The ventilating streams of air are drawn out of crankcase and rocker arm cover through the push rod compartment and outlet pipe. See figure 2-9.
The air passing through the crankcase, push rod compartment, and rocker arm cover picks up fuel and water vapors and removes them from the engine. The ventilating system does not remove all fuel dilution in cold weather as a small amount is advantageous in low temperature operation. It does, however, prevent an accumulation of more than 20 % fuel dilution and removes all water under average driving conditions.
The cooling system is sealed by a pressure type radiator filler cap which causes the system to operate at higher than atmospheric pressure. The higher pressure raises the boiling point of coolant and increases the cooling efficiency of the radiator. The seven pound pressure cap used on all series permits a possible increase of approximately 20°F in boiling point of coolant.
When the coolant is below normal operating temperature the thermostat valve closes and blocks circulation through the radiator. The water pump pressure forces the coolant through the by-pass passages to recirculate through the cylinder block and head. See figure 2-11. When the coolant in cylinder block and head reaches the proper temperature the thermostat valve starts to open and the circulation proceeds through the radiator in the normal way. At normal operating temperatures the thermostat is fully open. See figure 2-12.
Water entering the cylinder block water jacket from the pump moves to the rear end of the block before flowing upward into the cylinder head water jacket and thence forward to the radiator. This path of circulation provides maximum and uniform flow of coolant over all water jacketed surfaces.


For the past five years the Writing Center at Ball State University has helped numerous students. Their main purpose is to help and guide students in the right direction with their writing. The Writing Center gives one-on-one peer tutoring either through face-to-face, a chat, or simply through e-mail for quick questions. Many students enjoy the Writing Center in fact, "97% of students rated their session as a excellent or good and 98% of students would recommend us to a friend." The Writing Center is located at Robert Bell 291 (Main Center) and Bracken Library 302 (Drop-in-Center).
The Bracken Library provides help for students with general information on books, articles, images, music, movies and many more. The resources are not only for students but faculty (staff), extended education students, parents, visitors, and alumni as well. For more information contact library@bsu.edu.
"The Brief Penguin Handbook," is a great resource for all students. This book helps you improve your writing with grammar, punctuation, researching, MLA formatting, citations and many more. It helps students from F's to A's. This handbook has everything you need to know be successful with your writing.
The "Ball Point" is a PDF file that introduces writer's to the writing program at Ball State University. Click on the link below to download the file.


Samantha Janus admits that her first kissing scene with Scott Maslen was "uncomfortable".
EastEnders star Samantha Janus has admitted that her first kissing scene with co-star Scott Maslen made her feel "really uncomfortable".
The actress, who plays Ronnie Mitchell, revealed that she now copes better when she is required to be intimate with her real-life best friend Scott, better known as Jack Branning on the soap.
"We know each other really well," Samantha explained in an interview with Jonathan Ross. "Our first kissing scene felt really uncomfortable, it was terrible, but we're over it now."
Janus also spoke about how her co-star Adam Woodyatt (Ian Beale) likes to treat his fellow cast-members with unusual presents.
"He gave me a present of some lovely eggs, because he's got chickens," she said, "but he asked for the carton back!"


Location: Take note that Wake Up, Brother Bear! will actually be presented at ZACH North, located at 12129 N Ranch Rd 620 North, Suite 10, instead of at their main campus. At ZACH North, you'll find plenty of easy parking and no hassles of downtown driving.
Schedule & Tickets: This show runs from October 16 – April 2, 2019. You can attend a performance on Tuesdays and Thursdays at 10 a.m. & 12 p.m. or Sundays at 2 p.m. If you're worried about your toddlers attention spans, please note that run time is 35 minutes with no intermission (and they are welcome to be active participants). Tickets are $12 and can be purchased online here.
We can't wait to experience this show! You can learn much more about ZACH Theatre and their family productions by visiting zachtheatre.org.
After you go, we invite you to tell us what you think in the comments below!


text:
Q: Drawing a graph in latex? I need help with this code
It is my first time using latex
\documentclass[10pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{pgfplots}
\usepackage{calc}
\usepackage{pdfpages}
\usepackage{circuitikz}

\begin{document}
\begin{figure}[h]
\begin{minipage}[r]{0.49\textwidth}
\centering
\begin{tikzpicture}[scale=0.8]
\begin{axis}[grid=magor,
grid style={smooth},
xmin=0,xmax=3,
xlabel=$t$,
ylabel={$x(t),y(t)$},
variable=t]
\addplot[blue,line width=1,smooth]plot
[domain=0:3.5,samples=350]expression{(1+2t)exp(-2t)\sin(200t 3.14)};
\addplot[red,line width=1,smooth,style={dashed}]plot
[domain=0:3.5,samples=150]expression{(1+2t)exp(-2t)};
\addplot[red,line width=1,smooth,style={dashed}]plot
[domain=0:3.5,samples=150]expression{-(1+2t)exp(-2t)};
\end{axis}
\end{tikzpicture}
\caption{Damping sinusne funkcije}
\label{damping}
\end{minipage}
\end{figure}
\end{document}

A: Here is how your code should look
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{center}
\begin{tikzpicture}
\begin{axis}
[
    axis lines = middle,
    grid = major,
    xmin=0,
    xmax=3,
]
\addplot[smooth,blue,domain=0:3.5, variable=\t]
({\t},{(1+2*\t)*exp(2*\t)*sin(280*pi*t)});
\end{axis}
\end{tikzpicture}
\end{center}

\end{document}

Here are main parts of writing code for the plot. For centering your window you use \begin{center}.