python – program to check if there are duplicate words in line

As in the title I made a program with check, if in lines of text are double words and at the end the number of lines without double words is displayed.

This is a sample text:

sayndz zfxlkl attjtww cti sokkmty brx fhh suelqbp
xmuf znkhaes pggrlp zia znkhaes znkhaes
nti rxr bogebb zdwrin
sryookh unrudn zrkz jxhrdo zrkz
bssqn wbmdc rigc zketu ketichh enkixg bmdwc stnsdf jnz mqovwg ixgken

I have already created a program, and it looks like the program is working. However, I am aware that when programming works, it does not mean that the program has been created properly.

My code:

Class SkyphrasesValidation (Object):
def get_text_file (self):
File = open (& # 39; C: /Users/PC/Documents/skychallenge_skyphrase_input.txt&#39 ;, & # 39; r & # 39;
Return file

def lines_list (self):
text = self.get_text_file ()
line_list = text.readlines ()
return [line.split() for line in line_list]

    def phrasen_validation (self):
validated_phrases = 0
for line in self.lines_list ():
new_line = []
            for word in line:
Check = number of lines (word)
if test> 1:
new_line.append (0)
otherwise:
new_line.append (1)
if 0 in new_line:
validated_phrases + = 0
otherwise:
validated_phrases + = 1
returns validated_phrases

def __str __ (self):
return str (self.phrases_validation ())

text = SkyphrasesValidation ()

print (text)

Is my logic good and this program is well done, or maybe it looks like shit and I could make that clearer.

Command Line Interface – Linux Terminal. Home Network

This is a small part of the Find command. My netstat command shows a global network. be broadcast via international airports. It is 49,000 characters long. I've tried everything but bomb the damned airport. And almost all other commands are rejected. Or category does not exist

./system/app/Bluetooth/oat/arm64
./system/app/Bluetooth/oat/arm64/Bluetooth.odex
./system/app/Bluetooth/oat/arm64/Bluetooth.vdex
./system/app/Bluetooth/lib
./system/app/Bluetooth/lib/arm64
./system/app/Bluetooth/lib/arm64/libbluetooth_jni.so
./system/app/Bluetooth/Bluetooth.apk
./system/app/EmergencyAlert
./system/app/EmergencyAlert/EmergencyAlert.apk
./system/app/ESEServiceAgent
./system/app/ESEServiceAgent/ESEServiceAgent.apk
./system/app/Maps
./system/app/Maps/Maps.apk
./system/app/EasymodeContactsWidget81
./system/app/EasymodeContactsWidget81/EasymodeContactsWidget81.apk
./system/app/PhotoTable
./system/app/PhotoTable/PhotoTable.apk
./system/app/PacProcessor
./system/app/PacProcessor/lib
./system/app/PacProcessor/lib/arm64
./system/app/PacProcessor/lib/arm64/libjni_pacprocessor.so
./system/app/PacProcessor/PacProcessor.apk
./system/app/SecHTMLViewer
./system/app/SecHTMLViewer/SecHTMLViewer.apk
./system/app/EmergencyProvider
./system/app/EmergencyProvider/EmergencyProvider.apk
./system/app/CnnPanel
./system/app/CnnPanel/CnnPanel.apk
./system/app/SecureElement
./system/app/SecureElement/oat
./system/app/SecureElement/oat/arm64
./system/app/SecureElement/oat/arm64/SecureElement.odex
./system/app/SecureElement/oat/arm64/SecureElement.vdex
./system/app/SecureElement/SecureElement.apk
./system/app/AllshareFileShare
./system/app/AllshareFileShare/lib
./system/app/AllshareFileShare/lib/arm
./system/app/AllshareFileShare/lib/arm/libasf_fileshare.so
./system/app/AllshareFileShare/lib/arm/libasf_fileshareserver.so
./system/app/AllshareFileShare/AllshareFileShare.apk
./system/app/DAAgent
./system/app/DAAgent/DAAgent.apk
./system/app/BluetoothTest
./system/app/BluetoothTest/BluetoothTest.apk
./system/app/VideoEditorLite_Dream_N
./system/app/VideoEditorLite_Dream_N/VideoEditorLite_Dream_N.apk
./system/app/EmergencyModeService
./system/app/EmergencyModeService/EmergencyModeService.apk
./system/app/MnoDmClient
./system/app/MnoDmClient/MnoDmClient.apk
./system/app/RoseEUKor
./system/app/RoseEUKor/RoseEUKor.apk
./system/app/UniversalSwitch
./system/app/UniversalSwitch/UniversalSwitch.apk
./system/app/CarrierDefaultApp
./system/app/CarrierDefaultApp/CarrierDefaultApp.apk
./system/app/HandwritingService
./system/app/HandwritingService/HandwritingService.apk
./system/app/vzw_msdc_api
./system/app/vzw_msdc_api/vzw_msdc_api.apk
./system/app/GooglePrintRecommendationService
./system/app/GooglePrintRecommendationService/GooglePrintRecommendationService.apk
./system/app/UnifiedWFC
./system/app/UnifiedWFC/UnifiedWFC.apk
./system/app/AASAservice
./system/app/AASAservice/AASAservice.apk
./system/app/FBAppManager_NS
./system/app/FBAppManager_NS/FBAppManager_NS.apk
./system/app/WifiGuider
./system/app/WifiGuider/WifiGuider.apk
./system/app/KnoxKeyChain
./system/app/KnoxKeyChain/KnoxKeyChain.apk
./system/app/GoogleTTS
./system/app/GoogleTTS/GoogleTTS.apk
./system/app/SilentLog
./system/app/SilentLog/SilentLog.apk
./system/app/FactoryAirCommandManager
./system/app/FactoryAirCommandManager/FactoryAirCommandManager.apk
./system/app/GoogleVrServices
./system/app/GoogleVrServices/GoogleVrServices.apk
./system/app/DumpCollector
./system/app/DumpCollector/DumpCollector.apk
./system/app/SplitSoundService
./system/app/SplitSoundService/SplitSoundService.apk
./system/app/ANTPlusTest
./system/app/ANTPlusTest/ANTPlusTest.apk
./system/app/smcinvokepkgmgr
./system/app/smcinvokepkgmgr/smcinvokepkgmgr.apk
./system/app/com.qualcomm.qti.services.secureui
./system/app/com.qualcomm.qti.services.secureui/com.qualcomm.qti.services.secureui.apk
./system/app/BookmarkProvider
./system/app/BookmarkProvider/BookmarkProvider.apk
./system/app/InputEventApp
./system/app/InputEventApp/InputEventApp.apk
./system/app/AdvSoundDetector2015
./system/app/AdvSoundDetector2015/AdvSoundDetector2015.apk
./system/app/CoolEUKor
./system/app/CoolEUKor/CoolEUKor.apk
./system/app/SCPMClient_N
./system/app/SCPMClient_N/SCPMClient_N.apk
./system/app/Panorama360Viewer
./system/app/Panorama360Viewer/Panorama360Viewer.apk
./system/app/SamsungPassAutofill_v1
./system/app/SamsungPassAutofill_v1/SamsungPassAutofill_v1.apk
./system/app/SBrowser_9.0
./system/app/SBrowser_9.0/SBrowser_9.0.apk
./system/app/SmartFittingService
./system/app/SmartFittingService/SmartFittingService.apk
./system/app/talkback
./system/app/talkback/talkback.apk
./system/app/YahooEdgeSports
./system/app/YahooEdgeSports/YahooEdgeSports.apk
./system/app/KnoxAttestationAgent
./system/app/KnoxAttestationAgent/KnoxAttestationAgent.apk
./system/app/MirrorLink
./system/app/MirrorLink/MirrorLink.apk
./system/app/ChocoEUKor
./system/app/ChocoEUKor/ChocoEUKor.apk
./system/app/SecFactoryPhoneTest
./system/app/SecFactoryPhoneTest/oat
./system/app/SecFactoryPhoneTest/oat/arm64
./system/app/SecFactoryPhoneTest/oat/arm64/SecFactoryPhoneTest.vdex
./system/app/SecFactoryPhoneTest/oat/arm64/SecFactoryPhoneTest.odex
./system/app/SecFactoryPhoneTest/SecFactoryPhoneTest.apk
./system/app/CtsShimPrebuilt
./system/app/CtsShimPrebuilt/CtsShimPrebuilt.apk
./system/app/QdcmFF
./system/app/QdcmFF/QdcmFF.apk
./system/app/AutomationTest_FB
./system/app/AutomationTest_FB/AutomationTest_FB.apk
./system/app/atfwd
./system/app/atfwd/atfwd.apk
./system/app/MotionPanoramaViewer
./system/app/MotionPanoramaViewer/MotionPanoramaViewer.apk
./system/app/SBrowserEdge
./system/app/SBrowserEdge/SBrowserEdge.apk
./system/app/AmazonVideo_SPR_stub
./system/app/AmazonVideo_SPR_stub/AmazonVideo_SPR_stub.apk
./system/app/SmartSwitchAgent
./system/app/

GUI design – suggest visualization for control line and Waning line

Enter the image description hereI need to display parameter 100 and its current value in relation to the upper / lower control value and the warning value. Each parameter has a different control / warning line.

I designed a model with a grid of parameters, where each row has a column of that image, representing its value between the upper and lower bounds.

The yellow line represents Warning, but I am having trouble distinguishing / visualizing when the upper / warning limit is exceeded

python – Simple command line roulette game

I developed a simple command line roulette game. Your only options are color, but you can bet multiple times in a round

Import a copy
Import distutils.core
import sleep from sleep
Random import randint

red_slots = (1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36)
black_slots = (2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35)
master_color_dict = {red red #: 0, black black #: 0, green green #: 0}
quit = false
bal = 500

def roll (num, bet_choice, color_choice):
color_dict = master_color_dict.copy ()
Hit = 0
for _ in the range (num):
sleep (.1)
r = randint (0.36); print (r, end = "")
if r in red_slots:
color_dict['red']+ = 1
if color_choice == & # 39; red & # 39 ;:
Hit + = 1
print (& # 39; - HIT x & # 39; str (hits))
otherwise:
to press()
elif r in black_slots:
color_dict['black']+ = 1
if color_choice == & # 39; black & # 39 ;:
Hit + = 1
print (& # 39; - HIT x & # 39; str (hits))
otherwise:
to press()
elif r == 0:
color_dict['green']+ = 1
if color_choice == & # 39; green & # 39 ;:
Hit + = 1
print (& # 39; - HIT x & # 39; str (hits))
otherwise:
to press()

if color_choice == & # 39; red & # 39 ;:
return color_dict[color_choice]* bet_choice - color_dict['black']* bet_choice - color_dict['green']* bet_choice
elif color_choice == & # 39; black & # 39 ;:
return color_dict[color_choice]* bet_choice - color_dict['red']* bet_choice - color_dict['green']* bet_choice
elif color_choice == & # 39; green & # 39 ;:
return color_dict[color_choice]* bet_choice * 34 - color_dict['black']* bet_choice - color_dict['red']* bet_choice

Def color selection (msg):
while true:
To attempt:
Color = input (msg)
if color == & # 39; r & # 39; or color == & # 39; red & # 39 ;:
Return & # 39; red & # 39;
elif color == & # 39; b & # 39; or color == & # 39; black & # 39 ;:
back & # 39; black & # 39;
elif color ==? g & # 39; or color == "green":
Return & # 39; green & # 39;
otherwise:
print ("Invalid input")
except ValueError:
print ("Invalid input")

select def between (msg):
while true:
To attempt:
bet = int (input (msg))
if bet> = 0 and bet <= bal:
                return bet
            elif bet > bal:
print ("You do not have enough money!")
elif bet <0:
print ("You can not bet negative money!")
except ValueError:
print ("Please enter a positive integer less than or equal to your balance")

def Rollchoose (msg):
while true:
To attempt:
rc = int (input (msg))
if rc * bet_choice <= bal and rc > 0:
Return rc
elif rc * bet_choice> bal:
print (f "You can not afford to roll {rc} times")
elif rc <= 0:
                print("Please enter a positive integer")
        except ValueError:
            print("Please enter a positive integer")

def money_change_format(num,paren=False):
    if num >= 0 and paren == true:
return & # 39; (+ $% d) & # 39;% (num)
elif num < 0 and paren == True:
        return '(-$%d)' % (-num)
    elif num >= 0 and paren == False:
return & # 39;; $% d & # 39;% (num)
otherwise:
return? - $% d?% (-num)

def padding (msg):
while true:
To attempt:
rep = distutils.util.strtobool (input (msg))
if rep == 0 or rep == 1:
repeat rep
otherwise:
print (& # 39; Please indicate if you want to fill up your balance & # 39;)
except ValueError:
print (& # 39; Please indicate if you want to fill up your balance & # 39;)

print ("Welcome to Roulette! Payouts are x2 for Black and Red and x35 for Green, your starting balance is $ 500  n").

while not stopping:
while bal> 0:
color_choice = colorchoose (& # 39; Which color would you like to bet on? & # 39;)
bet_choice = betchoose (& # 39; How much money do you want to spend? & # 39;)
roll_choice = rollchoose (& # 39; How many times would you like to roll? & # 39;)

old_bal = copy.copy (bal)
bal = bal + roll (roll_choice, bet_choice, color_choice)
print (& # 39; New Balance: & # 39 ;, & # 39; $ & # 39; + str (bal), money_change_format (bal-old_bal, True))

rep = refill ("You're broke! Want to top up your account balance of $ 500?")
if rep: bal + = 500; Print (& # 39; New Balance: $ 500 (+ $ 500) & # 39;)
elif not rep: quit = true

print (& # 39; play again and again! & # 39;)

`` `

Command Line – Use Insert Key to toggle the Insert / Overwrite mode in Bash Terminal

After years of trouble, I finally set up the insert / overwrite mode in Bash Terminal by creating this file:

$ cat ~ / .inputrc

# ~ / .inputrc - adds / etc / inputrc - global inputrc for libreadline
# April 15, 2019
# For more information, see readline (3readline) and `info rluserman & # 39 ;.

$ include / etc / inputrc

Control-o: overwrite mode

See: info rluserman

I could always contact the previous command with the (Up arrow) and position the cursor for editing. I have always been annoyed to have to delete characters and insert new ones instead of replacing them.

Now I can type Ctrl+O Disable insert mode and type in existing characters. Then tap Ctrl+O again to restore the insert mode.

But how can I assign that? Insert Key instead Ctrl+O Switch Overwrite mode on and off?

Schengen – Can a non-EU citizen traveling with me come along through the EU passport line?

Generally not. Non-EU citizens who are family members of EU citizens within the meaning of the Free Movement Directive are allowed to use the EU passport rules at the Schengen borders, other travelers are not.

Of course you can accompany him in the queue "all passports". Although this saves no time, but at least should be less boring and / or sociable.

MySQL This is the first line from the subquery if you use the aggregate function

This is my request:

CHOOSE
COUNT (runs_scored) - SUM (IF (extra_type_id = 4, 1, 0)) AS-Spheres,
SUM (running_valued) + SUM (IF (extra_type_id IN (2, 4),
extra_runs,
0)) AS-runs,
SUM (IF (kind_out IN (1, 2, 4, 6, 7, 8)),
1
0)) AS Wickets
FROM
ball_by_ball BBB
CONNECT LINKS
`database`.batsman_scored BS USING (match_id, over_id, ball_id, innings_no)
CONNECT LINKS
`database`.extra_runs ER USING (match_id, over_id, ball_id, innings_no)
CONNECT LINKS
`database`.wicket_taken WT USING (match_id, over_id, ball_id, innings_no)
FROM WHERE
Bowler = 70
GROUP BY match_id
ORDER Wickets DESC, Runs;

This is issue:

+ ------- + ------ + --------- +
| Balls | Running | Wickets |
+ ------- + ------ + --------- +
| 24 | 28 | 3 |
| 24 | 23 | 2 |
| 24 | 32 | 2 |
| 24 | 23 | 1 |
| 18 | 27 | 1 |
| 12 | 10 | 0 |
| 12 | 17 | 0 |
| 6 | 18 | 0 |
| 18 | 19 | 0 |
| 18 | 28 | 0 |
+ ------- + ------ + --------- +

This is my last request:

CHOOSE
SUM (balls) AS balls,
SUM (running) AS is running,
SUM (Wickets) AS Wickets
FROM
(CHOOSE
COUNT (runs_scored) - SUM (IF (extra_type_id = 4, 1, 0)) AS-Spheres,
SUM (Running_valued) + SUM (IF (extra_type_id IN (2, 4), extra_runs, 0)) AS runs
SUM (IF (art_out IN (1, 2, 4, 6, 7, 8), 1, 0)) AS Wickets
FROM
ball_by_ball BBB
LEFT JOIN `database`.batsman_scored BS USING (match_id, over_id, ball_id, innings_no)
LEFT JOIN `database`.extra_runs ER USING (match_id, over_id, ball_id, innings_no)
LEFT JOIN `database`.wicket_taken WT USING (match_id, over_id, ball_id, innings_no)
FROM WHERE
Bowler = 70
GROUP BY match_id
ORDER BY Wickets DESC, Running) AS A;

This is issue:

+ ------- + ------ + --------- +
| Balls | Running | Wickets |
+ ------- + ------ + --------- +
| 180 | 225 | 9 |
+ ------- + ------ + --------- +

But I want to get the maximum wickets and Running As below:

+ ------- + ------ + --------- + --------- +
| Balls | Running | Wickets | Max (W / R) |
+ ------- + ------ + --------- + --------- +
| 180 | 225 | 9 | 3/28 |
+ ------- + ------ + --------- + --------- +

Here 3 are wickets and 28 are Running from which I came subquery first line, How can I do that from my last query? I need subquery first line Values ​​that are already sorted according to my requirement. I tried WINDOWS FUNCTION that does not work

Error wp-db.php on line 1172

From time to time, my site has displayed these errors in the log:

Warning: mysqli_real_escape_string () expects parameter 2 to be a string specified in / .. mypath … /wp-includes/wp-db.php on line 1172

Is there a way to find out which module could cause this error?