query_id
stringlengths
4
64
query_authorID
stringlengths
6
40
query_text
stringlengths
66
72.1k
candidate_id
stringlengths
5
64
candidate_authorID
stringlengths
6
40
candidate_text
stringlengths
9
101k
39ea77cea57acdbabc18efcb6c78bf849f5066176e1f42fd9a38345aadbd2cde
['a6fca189f953478eaf66780084b1d0a9']
I'm trying to load a new frame when the user presses the login button as long as the details entered are correct. I've included print commands within the LogInCheck function in order to see if the code is executing correctly, which it is. My only problem is that it wont change the frame. I get the error 'LogIn' object missing attribute 'show_frame' from tkinter import * from tkinter import ttk import tkinter as tk LARGE_FONT= ("Arial", 16) SMALL_FONT= ("Arial", 12) current_tariff = None def tariff_A(): global current_tariff current_tariff= "A" def tariff_B(): global current_tariff current_tariff= "B" def tariff_C(): global current_tariff current_tariff= "C" class PhoneCompany(tk.Tk): def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) container = tk.Frame(self) container.pack(side="top", fill="both", expand = True) container.grid_rowconfigure(0, weight=1) container.grid_columnconfigure(0, weight=1) self.frames = {} for F in (StartPage, PageOne, PageTwo, PageThree, PageFour, PageFive, LogIn): frame = F(container, self) self.frames[F] = frame frame.grid(row=0, column=0, sticky="nsew") self.show_frame(LogIn) def show_frame(self, cont): frame = self.frames[cont] frame.tkraise() Thats my main class and this is the login page class: class LogIn(tk.Frame): def LogInCheck(self): global actEntry global pinEntry act = "james" pin = "Python123" actNum = actEntry.get() pinNum = pinEntry.get() print("FUNCTION RUN") if actNum == act and pinNum == pin: print("CORRECT") self.show_frame(StartPage) elif actNum != act or pinNum != pin: print("INCORRECT") self.show_frame(LogIn) def __init__(self, parent, controller): global actEntry global pinEntry self.controller = controller tk.Frame.__init__(self, parent) logLabel = ttk.Label(self, text = "Login With Your Username and Password", font = LARGE_FONT) logLabel.pack(side = TOP, anchor = N, expand = YES) actLabel = Label(self, text = 'Username:') actEntry = Entry(self) pinLabel = Label(self, text = 'Password: ') pinEntry = Entry(self, show ="*") actLabel.pack(pady =10, padx = 10, side = TOP, anchor = N) pinLabel.pack(pady =5, padx = 10, side = TOP, anchor = S) actEntry.pack(pady =10, padx = 10, side = TOP, anchor = N) pinEntry.pack(pady =5, padx = 10, side = TOP, anchor = S) logInButton = tk.Button(self, text = "Login", command = self.LogInCheck) logInButton.pack(side = TOP, anchor = S) quitButton = tk.Button(self, text = "Quit", command = quit) quitButton.pack(side = BOTTOM, anchor = S) if __name__ == "__main__": app = PhoneCompany() app.mainloop() I'll include my full code if you need to look at the rest of it: from tkinter import * from tkinter import ttk import tkinter as tk LARGE_FONT= ("Arial", 16) SMALL_FONT= ("Arial", 12) current_tariff = None def tariff_A(): global current_tariff current_tariff= "A" def tariff_B(): global current_tariff current_tariff= "B" def tariff_C(): global current_tariff current_tariff= "C" class PhoneCompany(tk.Tk): def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) container = tk.Frame(self) container.pack(side="top", fill="both", expand = True) container.grid_rowconfigure(0, weight=1) container.grid_columnconfigure(0, weight=1) self.frames = {} for F in (StartPage, PageOne, PageTwo, PageThree, PageFour, PageFive, LogIn): frame = F(container, self) self.frames[F] = frame frame.grid(row=0, column=0, sticky="nsew") self.show_frame(LogIn) def show_frame(self, cont): frame = self.frames[cont] frame.tkraise() class StartPage(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self,parent) label = tk.Label(self, text="MENU", font=LARGE_FONT) label.pack(pady=10,padx=10) button = tk.Button(self, text="View Account Balance", command=lambda: controller.show_frame(PageOne)) button.pack() button2 = tk.Button(self, text="Display Current Tariff", command=lambda: controller.show_frame(PageTwo)) button2.pack() button3 = tk.Button(self, text="View List of Rates", command=lambda: controller.show_frame(PageThree)) button3.pack() button4 = tk.Button(self, text="View Latest Bill", command=lambda: controller.show_frame(PageFour)) button4.pack() class PageOne(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) label = tk.Label(self, text="Account Balance", font=LARGE_FONT) label.pack(pady=10,padx=10) sublabel = tk.Label(self, text="Your current account balance is £230", font=SMALL_FONT) sublabel.pack(pady=10,padx=10) button1 = tk.Button(self, text="Back to Menu", command=lambda: controller.show_frame(StartPage)) button1.pack() class PageTwo(tk.Frame): def __init__(self, parent, controller): global current_tariff tk.Frame.__init__(self, parent) label = tk.Label(self, text="Current Tariff", font=LARGE_FONT) label.pack(pady=10,padx=10) sublabel = tk.Label(self, text="Your current tariff is "+str(current_tariff), font=SMALL_FONT) sublabel.pack(pady=10,padx=10) button1 = tk.Button(self, text="Change Tariff", command=lambda: controller.show_frame(PageFive)) button1.pack() button2 = tk.Button(self, text="Back to Home", command=lambda: controller.show_frame(StartPage)) button2.pack() class PageThree(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) label = tk.Label(self, text="Tariff Rates", font=LARGE_FONT) label.pack(pady=10,padx=10) sublabel = tk.Label(self, text="Peak Rates: A: £0.30 | B: £0.10 | C: £0.90", anchor="w", font=SMALL_FONT) sublabel.pack(pady=10,padx=10) sublabel2 = tk.Label(self, text="Off Peak: A: £0.05 | B: £0.02 | C: -", anchor="w", font=SMALL_FONT) sublabel2.pack(pady=10,padx=10) sublabel3 = tk.Label(self, text="Line Rental: A: £15.00 | B: £20.00 | C: £30.00", anchor="w", font=SMALL_FONT) sublabel3.pack(pady=10,padx=10) button1 = tk.Button(self, text="Back to Home", command=lambda: controller.show_frame(StartPage)) button1.pack() class PageFour(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) label = tk.Label(self, text="Latest Bill", font=LARGE_FONT) label.pack(pady=10,padx=10) button1 = tk.Button(self, text="Back to Home", command=lambda: controller.show_frame(StartPage)) button1.pack() class PageFive(tk.Frame): def __init__(self, parent, controller): global current_tariff tk.Frame.__init__(self, parent) label = tk.Label(self, text="Change Tariff", font=LARGE_FONT) label.pack(pady=10,padx=10) sublabel = tk.Label(self, text="Select new tariff\nView list of tariff rates on the main menu to see the prices.", font=SMALL_FONT) sublabel.pack(pady=10,padx=10) button1 = tk.Button(self, text="A", command=lambda:[controller.show_frame(StartPage),tariff_A]) button1.pack() button2 = tk.Button(self, text="B", command=lambda:[controller.show_frame(StartPage),tariff_B]) button2.pack() button3 = tk.Button(self, text="C", command=lambda:[controller.show_frame(StartPage),tariff_C]) button3.pack() button4 = tk.Button(self, text="Back to Home", command=lambda: controller.show_frame(StartPage)) button4.pack() class LogIn(tk.Frame): def LogInCheck(self): global actEntry global pinEntry act = "james" pin = "Python123" actNum = actEntry.get() pinNum = pinEntry.get() print("FUNCTION RUN") if actNum == act and pinNum == pin: print("CORRECT") self.show_frame(StartPage) elif actNum != act or pinNum != pin: print("INCORRECT") self.show_frame(LogIn) def __init__(self, parent, controller): global actEntry global pinEntry self.controller = controller tk.Frame.__init__(self, parent) logLabel = ttk.Label(self, text = "Login With Your Username and Password", font = LARGE_FONT) logLabel.pack(side = TOP, anchor = N, expand = YES) actLabel = Label(self, text = 'Username:') actEntry = Entry(self) pinLabel = Label(self, text = 'Password: ') pinEntry = Entry(self, show ="*") actLabel.pack(pady =10, padx = 10, side = TOP, anchor = N) pinLabel.pack(pady =5, padx = 10, side = TOP, anchor = S) actEntry.pack(pady =10, padx = 10, side = TOP, anchor = N) pinEntry.pack(pady =5, padx = 10, side = TOP, anchor = S) # runs the 'LoginCheck' function logInButton = tk.Button(self, text = "Login", command = self.LogInCheck) logInButton.pack(side = TOP, anchor = S) quitButton = tk.Button(self, text = "Quit", command = quit) quitButton.pack(side = BOTTOM, anchor = S) if __name__ == "__main__": app = PhoneCompany() app.mainloop() I know it's quite messy and there may be other errors, but for now i just need to figure out why it wont change the frame after successfully logging in.
f67c076d05b54cc11e64f1135f88c49e9ae749e001ced9223fc714f9ab609b5f
['a6fca189f953478eaf66780084b1d0a9']
I'm trying to ask the user to input a number (in this example, they need to enter a number of minutes into the minEntry box). I want to take this number and use it to set multiple variable values by multiplying this value with other numbers. Then i want to take this value and have it displayed in the sublabel box within the __init__ function. Im getting an error message that says 'PageSix' object has no attribute 'peak_rate'. I sort of know what this means but i have no idea how to solve it. class PageSix(tk.Frame): def projected_figures(self): global minEntry tariff = self.controller.page_get(PageTwo) minutes=minEntry.get() self.peak_rate = tk.StringVar() self.peak_rate.set(0) self.off_peak = tk.StringVar() self.off_peak.set(0) self.line_rental = tk.StringVar() self.line_rental.set(0) if tariff.current_tariff == "A": self.peak_rate.set("Peak Rate: £"+minutes*0.3) self.off_peak.set("Off-Peak: £"+minutes*0.05) self.line_rental.set("Line Rental: £15") elif tariff.current_tariff == "B": self.peak_rate.set("Peak Rate: £"+minutes*0.1) self.off_peak.set("Off-Peak: £"+minutes*0.02) self.line_rental.set("Line Rental: £20") else: self.peak_rate.set("Peak Rate: £"+minutes*0.9) self.off_peak.set("Off-Peak: -") self.line_rental.set("Line Rental: £30") def __init__(self, parent, controller): tk.Frame.__init__(self, parent) self.controller=controller label = tk.Label(self, text="Account Balance", font=LARGE_FONT) label.pack(pady=10,padx=10) sublabel = tk.Label(self, textvariable=self.peak_rate, font=SMALL_FONT) sublabel.pack(pady=10,padx=10) sublabel2 = tk.Label(self, textvariable=self.off_peak, font=SMALL_FONT) sublabel2.pack(pady=10,padx=10) sublabel3 = tk.Label(self, textvariable=self.line_rental, font=SMALL_FONT) sublabel3.pack(pady=10,padx=10) minLabel = Label(self, text = 'Enter Minutes: ') minEntry = Entry(self) minLabel.pack(pady =10, padx = 10, side = TOP, anchor = S) minEntry.pack(pady =10, padx = 10, side = TOP, anchor = S) button1 = tk.Button(self, text="View Projected Figures", command=self.projected_figures) button1.pack() button2 = tk.Button(self, text="Back to Menu", command=lambda: controller.show_frame(StartPage)) button2.pack() Also the lines tariff = self.controller.get_page(PageTwo) and if self.current_tariff == "x" are referring to this class if it can be of any use. class PageTwo(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) self.controller=controller self.current_tariff = tk.StringVar() self.current_tariff.set("A") label = tk.Label(self, text="Current Tariff", font=LARGE_FONT) label.pack(pady=10,padx=10) sublabel = tk.Label(self, textvariable=self.current_tariff, font=SMALL_FONT) sublabel.pack(pady=10,padx=10) button1 = tk.Button(self, text="Change Tariff", command=lambda: controller.show_frame(PageSix)) button1.pack() button2 = tk.Button(self, text="Projected Figures", command=lambda: controller.show_frame(PageSix)) button2.pack() button3 = tk.Button(self, text="Back to Home", command=lambda: controller.show_frame(StartPage)) button3.pack()
54700f70cd11e862929ea706ef6461db9c49410b7db3c4745948e895b258008f
['a70e0bbb0ce3486eabb1c44df058f8c0']
Just change the syntax you use to select element from input[class='.form-check-input.tailID_checkbox'] to input.form-check-input.tailID_checkbox. Run this demo to see it works: $("#check_rt").change( function(){ console.log('checking toggle all'); var checked = $(this).prop('checked'); console.log('checked=', checked); if (checked == true ) { $.each( $("input.form-check-input.tailID_checkbox"), function() { console.log('iterating'); $(this).prop('checked', true); }); } else { $.each($("input.form-check-input.tailID_checkbox"), function() { console.log('iterating'); $(this).prop('checked', false); }); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="form-group"> <div class="form-check form-check-inline" ><input class="form-check-input tailID_checkbox" type="checkbox" id="CAP483" value="300434060981730"><label class="form-check-label" for="CAP483">CAP483</label></div> <div class="form-check form-check-inline" ><input class="form-check-input tailID_checkbox" type="checkbox" id="CAP485" value="300434060047540"><label class="form-check-label" for="CAP485">CAP485</label></div> <div class="form-check form-check-inline" ><input class="form-check-input tailID_checkbox" type="checkbox" id="CAP487" value="300434060081220"><label class="form-check-label" for="CAP487">CAP487</label></div> <div class="form-check form-check-inline" ><input class="form-check-input tailID_checkbox" type="checkbox" id="CAP498" value="300434060705410"><label class="form-check-label" for="CAP498">CAP498</label></div> </div> <div class="form-check"><input class="form-check-input" type="checkbox" id="check_rt"><label class="form-check-label" for="rt-toggle-all">Toggle All</label></div>
17c9d1df8530a5d36cecfb3b3f25e89eb2925263e2d7aa80cfb081bf363a1d09
['a70e0bbb0ce3486eabb1c44df058f8c0']
You can override the validate function (but it is a bit dirty): function validate() { console.log('default validator'); return false; } var defaultValidator = validate; window.validate = function () { defaultValidator(); console.log('custom validator'); return false; }; <form id="form" method="POST" onsubmit="return validate()"> <input type="text" id="name" name="name"> <input type="submit" value="next"> </form>
b27572910c60a04afb7231756f624fb3cb13e9a0c29298df0956d3ecb2dc7190
['a71229acbeb1438b82c2cebe1346c793']
I am trying to install and configure ICEhrm . However I was successfully able to unzip the file. Here is my app/config.php file <?php ini_set('error_log', 'data/icehrm.log'); define('CLIENT_NAME', 'app'); define('APP_BASE_PATH', '/var/www/icehrm/'); define('CLIENT_BASE_PATH', '/var/www/icehrm/app/'); define('BASE_URL','http://hr.mycompany.com/icehrm/'); define('CLIENT_BASE_URL','http://hr.mycompany.com/icehrm/app/'); define('APP_DB', 'icehrm_db'); define('APP_USERNAME', 'icehrm_user'); define('APP_PASSWORD', 'password'); define('APP_HOST', 'localhost'); define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB); //file upload define('FILE_TYPES', 'jpg,png,jpeg'); define('MAX_FILE_SIZE_KB', 10 * 1024); And my nginx file is: server { #see: http://wiki.nginx.org/Pitfalls # see: http://wiki.nginx.org/IfIsEvil listen 80; root /var/www/icehrm; index index.html index.htm index.php; error_page 404 /index.php; # Make site accessible from http://set-ip-address.xip.io server_name hr.mycompony.com; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log error; charset utf-8; location / { try_files $uri $uri/ =404; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } But whenever I am going to hr.mycompany.com it redirecting to hr.mycompany.com/icehrm/app/login.php and the page is blank. Please advise whats am I doing wrong. Thanks, <PERSON> ~
cb137e7269469c9aa45490d58ab102a5cf7a67a39d667555c1dd2e6774c90647
['a71229acbeb1438b82c2cebe1346c793']
Мне нужно взять конкретное значение из базы данных и вставить его в модальное окно. Но и нужно, чтобы обращение к ключу было глобальным, то есть, ко всем возможным biography. Поясню легче на деле. Сам проект - веб-игра, в которой игрок может вести свое biography. И сам игрок, нажав на кнопку в профиле другого игрока, выводит его biography на модальном окне.
3c7bf2cd5a3b4ab92ddd961ad5c66c11c9d0b23a01847daca8b443a83d513dbf
['a7139be3688b4f39bce9843dd546cc7c']
You could use just css for it but js can help, here follow my simple code. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title></title> <style type="text/css"> div.image-box{display:block;position:relative;overflow:hidden;width:200px;border:1px solid #ccc;padding:0;height:200px;} div.image-box img{width:100%;height:auto;margin:0; padding:0;margin-bottom:-4px;position:absolute;top:0;left:0;} div.image-box.horizontal img{height:100%;width:auto;left:50%;} div.image-box.vertical img{height:auto;width:100%;top:50%;} </style> </head> <body> <div class="image-box"><img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcS08-IWtcbvcehgeszlD2nI6s-OAungNCsLNIc-f3QjIOkvOq8abg" alt=""></div> <div class="image-box"><img src="http://1.bp.blogspot.com/_e-y-Rrz58H4/TUS4qRlRUrI/AAAAAAAABQo/H322eTHRB2s/s1600/Man_Face.jpg" alt=""></div> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.image-box').each(function(){ if($(this).find('img').height() > $(this).find('img').width()){ $(this).addClass('vertical'); $(this).find('img').css('margin-top','-'+$(this).find('img').height()/2+'px'); }else{ $(this).addClass('horizontal'); $(this).find('img').css('margin-left','-'+$(this).find('img').width()/2+'px'); } }); }); </script> </body> </html> Hope that helps
d671f6e6072812b2f914893a2a2c894092dcbc0ac541b744b44344620de5b64c
['a7139be3688b4f39bce9843dd546cc7c']
Have you already tried to clear cache and cookies? also some times you have to do it on the shell on /path/to/my/magento/folder/var/cache just run "rm -fr *". If that doesn't work you can check you files ownership and permissions (the http service has to have the write write permissions an ownership on the files and folder - http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions). Hope that works for you.
1d30c05e3aa36af4bcc39d44febb18ed310e722d7a02e86723acbf438412f55e
['a71aedb898924642b6be3ccbeb06273d']
SoftLayer_Hardware/{bmserverID}/rebootSoft.json Above REST API is working and reboot of bare metal server is success. After some time if we invoke stop (SoftLayer_Hardware/{bmserverID}/powerOff) OR reboot we are getting the error message as : {"error":"Cannot issue command at this time. A Remote management command has recently been issued for server ..","code":"SoftLayer_Exception_Public"}
9dfd3fdbd9bb8faabfacda5a20edbf291042250667b8d8a7c081e61359e38523
['a71aedb898924642b6be3ccbeb06273d']
Convert the xml into xsd. After that using eclipse, create jaxb project and point to xsd. java files will be generated based on the xsd file. Once java schema files are generated, you can use marshall and unmarsahll code. private static JAXBContext _jaxbContext; static { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(Connection.class.getClassLoader()); //NOPMD. StringBuffer sb = new StringBuffer(); sb.append("com.microsoft.schemas.windowsazurerm"); //schema package name _jaxbContext = JAXBContext.newInstance(sb.toString()); } catch (Exception e) { logger.error(e); } finally { Thread.currentThread().setContextClassLoader(cl); } } Unmarshaller unmarshaller; Object object = null; try { unmarshaller = context.createUnmarshaller(); object = unmarshaller.unmarshal(new StreamSource(new StringReader(xml))); }
baaae08811cc28d6038f5795c02f933f2a2ab7620939f126110df82ea964a952
['a73087a41dea468ebcaec7db296213bc']
</global> </events> <adminhtml_block_html_before> <observers> <event_column_append> <type>model</type> <class>observer_class</class> <method>addFormEnctype</method> </event_column_append> </observers> </adminhtml_block_html_before> </events> </global> Observer method should looks like: public function addFormEnctype($observer){ $block = $observer->getEvent()->getBlock(); if ($block instanceof Class_Where_Form_Is_Instaniated){ $form = $observer->getBlock()->getForm(); $form->setData('enctype', 'multipart/form-data'); //depends of form what you wand modify $form->setUseContainer(true); } }
d0eef72797654a6dd94aaa98304850b08f57c4179bb47391af44d38bf2c4a6e0
['a73087a41dea468ebcaec7db296213bc']
if you want go alongside help topics you could use this query: SELECT cast(SUM(case when UB.B_VOL IS NULL then 0 else UB.B_VOL end) /cast(COUNT(DISTINCT UQ.Q_ID) as float) as decimal(8,2))FROM utQ AS UQ LEFT JOIN utB AS UB ON UQ.Q_ID = UB.B_Q_ID
675e78703770cbaf1f744d7f6ff028c30b667fe8acdd2b848bebe396333f4c81
['a733f607d9834a27ad21a09b4f701687']
I think you should fix it like this: db.collection("game") .doc(roomid.value) .get() .then((doc) => { if (doc.exists) { console.log("Document data:", doc.data()); } else { // doc.data() will be undefined in this case console.log("No such document!"); } }) .catch(function (error) { console.log("Error getting document:", error); }); You can read more here
c62ce1b058eb559e9de970a13b85624e3f72962485bb5d7928c072e45fd3417f
['a733f607d9834a27ad21a09b4f701687']
First you need to determine which prop will you get the value of? And then try this, in this case I will get "itemIds" so my findProp function will take 2 parameters: const myObj = { dbSessionTokenMap: { CXO_PC_ST: 'e5b96399-fefc-4d9d-93ba-2aa1059008ce|{"mtoken":"301:12#90271897#2=60818072#7=100439087"}', }, id: "e5b96399-fefc-4d9d-93ba-2aa1059008ce", checkoutFlowType: "Guest", cartId: "ffd6cb2f-efc2-47b2-96d9-52d2cfb3d69b", items: [ { id: "918e337d-82ae-4e91-bdc3-16ad06572e21", offerId: "864A02B3BF7442A4802E6DF7BA2EDA28", productId: "1ZPTYHZN85S6", productName: "Pokemon Assorted Lot of 50 Single Cards [Any Series]", itemId: 127446742, sellerId: "A577588AB81D43AE9E7F468183B3568A", thumbnailUrl: "https://i5.walmartimages.com/asr/aa6ed747-9cd0-44dc-b927-44bc2b7e1ca7_1.62c435484d4015af1c325e9cdeeb3662.jpeg?odnHeight=100&odnWidth=100&odnBg=FFFFFF", legacySellerId: 3340, productClassType: "REGULAR", quantity: 1, unitPrice: 8.61, type: "REGULAR", price: 8.61, unitOfMeasure: "EA", hasCarePlan: false, brand: "Pok?mon", discount: {}, rhPath: "20000:25000:25003:25114:25333", isWarrantyEligible: false, category: "0:4171:3318550:617941:8920388", primaryCategory: "Home Page/Toys/Shop Toys by Age/Toys for Kids 5 to 7 Years/Toys for Kids 5 to 7 Years", isCarePlan: false, isEgiftCard: false, isAssociateDiscountEligible: false, isShippingPassEligible: false, isTwoDayShippingEligible: false, classId: "5", maxQuantityPerOrder: 100, isSubstitutable: false, isInstaWatch: false, isAlcoholic: false, isSnapEligible: false, isAgeRestricted: false, isSubstitutionsAllowed: false, fulfillmentSelection: { fulfillmentOption: "S2H", shipMethod: "STANDARD", availableQuantity: 172, }, servicePlanType: "NONE", errors: [], wfsEnabled: false, isAlcohol: false, }, ], shipping: { postalCode: "82001", city: "CHEYENNE", state: "WY" }, promotions: [ { promotionId: "1c2cbad1-205e-425f-9297-8629d68e97f6", okToPayAwards: [ { applyTo: "CART_FULFILLMENT_PRICE", actionType: "AWARD", name: "DS_Donors_Choose_Teachers_Card", awardType: "OK_TO_PAY", description: "DonorsChoose Card", applicableTo: { ITEM_TAX: true, SHIP_PRICE: true, SHIP_TAX: true, FEE: true, ITEM_PRICE: true, }, asset: { image: "https://i5.walmartimages.com/dfw/63fd9f59-e0cf/455269aa-c4e8-46a5-8d76-5d4b458e1269/v1/Select_gift_card.png", imageAlt: "", }, awardEligibleItemIds: [], awardEligibleTotalsByItemId: {}, }, ], dsEligibleItemIds: [], dsEligibleTotals: {}, }, ], summary: { subTotal: 8.61, shippingIsEstimate: false, taxIsEstimate: true, grandTotal: 8.61, quantityTotal: 1, amountOwed: 8.61, merchandisingFeesTotal: 0, shippingCosts: [ { label: "Top Cut Central shipping", type: "marketplace_shipping", cost: 0.0, }, ], shippingTotal: 0.0, hasSurcharge: false, preTaxTotal: 8.61, addOnServicesTotal: 0, itemsSubTotal: 8.61, }, pickupPeople: [], email: "", buyer: { customerAccountId: "9afb345e-74b8-4afb-93d0-4bf52697e18f", isGuestSignupRequired: false, isGuest: true, isAssociate: false, applyAssociateDiscount: false, }, allowedPaymentTypes: [ { type: "CREDITCARD", cvvRequired: true }, { type: "PAYPAL", cvvRequired: false }, { type: "GIFTCARD", cvvRequired: false }, { type: "VISA_CHECKOUT", cvvRequired: false }, { type: "MASTERPASS", cvvRequired: false }, { type: "CHASEPAY", cvvRequired: false }, { type: "AMEX_CHECKOUT", cvvRequired: false }, ], registries: [], payments: [], cardsToDisable: [], allowedPaymentPreferences: [], isRCFEligible: false, isMarketPlaceItemsExist: true, version: "v3", shippingCategory: { shippingGroups: [ { itemIds: ["918e337d-82ae-4e91-bdc3-16ad06572e21"], seller: "Top Cut Central", defaultSelection: true, fulfillmentOption: "S2H", shippingGroupOptions: [ { method: "EXPEDITED", methodDisplay: "Expedited", selected: false, charge: 8.99, deliveryDate: 1606766400000, availableDate: 1606766400000, fulfillmentOption: "S2H", onlineStoreId: 0, isThresholdShipMethod: false, }, { method: "STANDARD", methodDisplay: "Standard", selected: true, charge: 0.0, deliveryDate: 1606939200000, availableDate: 1606939200000, fulfillmentOption: "S2H", onlineStoreId: 0, isThresholdShipMethod: false, }, ], isEdelivery: false, hasWFSItem: false, itemSellerGroups: [], }, ], }, entityErrors: [], oneDaySelected: false, paymentWithBagFee: false, giftDetails: { giftOrder: false, hasGiftEligibleItem: false, xoGiftingOptIn: false, }, canApplyDetails: [], dbName: "e5b96399-fefc-4d9d-93ba-2aa1059008ce|C", jwt: "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI1MjdmZTRjYi0wZjI5LTRjZWYtOWRiOS00Yzc1YWQ5MTMwNTQiLCJpYXQiOjE2MDYwOTY0NjMsImlzcyI6IjU3YjM0ZTNhZGE1MjkzMGEwYzBjYTFjOSIsIk9yZ1VuaXRJZCI6IjU2ZWJiMTJkZGE1MjkzMWRhOGZlMDc5YSIsIlJlZmVyZW5jZUlkIjoiZTViOTYzOTktZmVmYy00ZDlkLTkzYmEtMmFhMTA1OTAwOGNlIn0.-ta5UQLkJtXNR5yP2dOhDiDMF9dPpbfktAJu7z22kNM", }; const findProp = (obj, prop, out) => { let i, proto = Object.prototype, ts = proto.toString, hasOwn = proto.hasOwnProperty.bind(obj); if ("[object Array]" !== ts.call(out)) { out = []; } for (i in obj) { if (hasOwn(i)) { if (i === prop) { out.push(obj[i]); } else if ( "[object Array]" === ts.call(obj[i]) || "[object Object]" === ts.call(obj[i]) ) { findProp(obj[i], prop, out); } } } return out; }; console.log(findProp(myObj, "itemIds"));
e38794191796707f437b1861ff519f8416b674588087148335404fb4e4fec61a
['a744dbc813f44f7ebbd4ad117ae671fc']
I have a array1 from checkboxes selected, and i need to compare with the most similar, how i do that? var array1 = ["pain", "fever", "vomit"] var array2 = ["diarrhea", "fever", "vomit", "embolism", "bleeding"] var array3 = ["diarrhea", "tumor", "vomit", "cold", "bleeding"] I tried some methods but they only return me as "true" or "false", I would like to get the most similar array1
10313d51fb35f14c85df607d5f1c520bab17db9de653ecd16db5cd56376791dc
['a744dbc813f44f7ebbd4ad117ae671fc']
How to navigate between screens using buttons on the header? When I try to go back or navigate to other pages using header buttons I get the same error. The buttons on the screen work perfectly. "undefined is not an object (evaluating 'navigation.navigate') (Device)" "undefined is not an object (evaluating 'navigation.goBack')" import 'react-native-gesture-handler'; import React from 'react'; import { Text, View, StyleSheet, Button } from 'react-native'; import Constants from 'expo-constants'; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; const Stack = createStackNavigator(); //Screen 1 function HomeScreen({ navigation }) { return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>Home Screen</Text> <Button title="Details" onPress={() => navigation.navigate('Details')} /> </View> ); } //Screen 2 function DetailsScreen({ navigation }) { return ( <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <Text>Details</Text> <Button title="back home" onPress={() => navigation.goBack()} /> </View> ); } export default function App({ navigation, route }) { return ( <NavigationContainer> <Stack.Navigator initialRout="Home"> <Stack.Screen name="Home" component={HomeScreen} /> <Stack.Screen name="Details" component={DetailsScreen} options={{ headerTitle: () => <Text>Register</Text>, headerRight: () => <Button title="Test" onPress={() => navigation.navigate('Home')} />, headerLeft: () => <Button title="back home" onPress={() => navigation.goBack()} />, }} /> </Stack.Navigator> </NavigationContainer> ); } https://snack.expo.io/@camileppst/navigation-test
f315550d7ebf7cf3c648e025229b1f7e1c5698e201744c04a6248807d697f776
['a754a84b13d54924b34d4b5e409353dd']
As <PERSON> and <PERSON> says, your problem is that in your errorCallback() you aren't throwing the exception. See the following example (PLUNKER)... function bodyCtrl($timeout, $q){ deferred.promise .then(function(d) { //Promise 1 console.log("success called"); return d; }, function(e) { console.log("failure called"); throw e; //Throw instead return }) .then(function(d) { //Promise 2 console.log("success called2"); return d; }, function(e) { console.log("failure called2"); throw e; //Throw instead return }); $timeout(function() { deferred.reject("Custom Rejected: " + new Date()); }, 2000); }
e7348526fce80f92941bb6e77ecd58cce8d9b5eafa669a4e59adce92d402bcef
['a754a84b13d54924b34d4b5e409353dd']
You have to change the background-color of the <a></a> element inside your custom class. I've forked your plunker CSS: li.ddl-li a { background-color: yellow; } li.ddl-li a:hover { background-color: orange; } Option without add a custom class. You can override .dropdown-menu bootstrap class : ul.dropdown-menu li a { background-color: #eee; } ul.dropdown-menu li a:hover { background-color: #bbb; }
5c640b286062c899c219693d78a972d465fc299a26ffef53fc9aa145159e1c42
['a761addb72f54ba897b96926919085f9']
I need to open run two jar applications in the same time I know that to run a jar file you have to type java -jar app1.jar but I need to terminate the current process to run java -jar app2.jar How can I open app2 without closing app1 ?
1b18f1a793b237e0b78a10e5266ff2d8bb4740b11fb02f254c258599c77d4c55
['a761addb72f54ba897b96926919085f9']
I am learning nmap and I amm watching this video https://www.youtube.com/watch?v=hNThhluanlg at minute 2:30 the speaker does a simple ping scan but wants to perform it on the "whole network" for this purpose she uses her ip address but adds a "/" at the end and some numbers... What do ip addresses with "/" stand for ?
c0fa61dc9abc559708454ba2e20d99e6678ce1ac9195f38f63ef6667fc8b1e19
['a762c0bbc4f84d87acc117c8e4d6a201']
I have an unusual requirement where I need to mount the same filesystem on a client multiple times, but each mount offering a different view of the underlying data, based on the group permissions of the underlying directories and files. I have achieved this in the past with NFS and the all_squash and anongid /etc/exports option, making a specific mount appear as though the user had a specific group ID. It effectively filtered access to the underlying filesystem by forcing the accessing user's group. Unfortunately I can't use that in this scenario, as the filesystem will be Amazon EFS (effectively an NFS server, but without any configuration options). I have looked at bindfs, and this provides a force-group option, but this is the reverse of what I want, since it forces all files to have a specific group, rather than forcing the client to have a specific group, looking at the files unchanged. I did see a mention of something called filterfs, but it appears to be long dead. Does anybody know a way to get a filtered view of a file system for a single user by effectively changing the user's group on an ad-hoc basis (without using sudo, since the user is a webserver daemon).
d5974ac92b9f73f5b20f377a9193c79d13f41762d79e82f6fbc30bcdff5f232b
['a762c0bbc4f84d87acc117c8e4d6a201']
Initially, I thought they messed up the formula at the "Naive Bayesian" sight too, but it's actually correct. The problem is, there is so little context for why the author inserted that formula there, its difficult to figure out what it's purpose is. It turns out that the formula is modified to determine the probability of each class (binomial in this case) c and not-c given X (given all four attributes). Then the class with the higher attribute becomes the classification for the set of those four attributes. I will post answer below with more explanation and reference.
256d70f95d35421a3d3311af4b8d23383b7b1569231c2e14ed688930702ae42f
['a765a54dd1e34b4ca8f5618a68eb01eb']
Here is another implementation: fun getopt(args: Array<String>): Map<String, List<String>> { var last = "" return args.fold(mutableMapOf()) { acc: MutableMap<String, MutableList<String>>, s: String -> acc.apply { if (s.startsWith('-')) { this[s] = mutableListOf() last = s } else this[last]?.add(s) } } } Directly construct the map structure, but a reference for the last parameter should be kept for adding next arguments. This function is not so streaming, but just need 1 pass of data. And it just simply discard the leading arguments without a previous parameter.
24fe178bb9944d2be6cee0145cc790e692c9e2cd805e04526572153996a4c869
['a765a54dd1e34b4ca8f5618a68eb01eb']
.ppk file is a PuTTY only file, which is generated by PuTTYgen, where https://unix.stackexchange.com/q/74545/263854 has a better and detailed introduction. As https://askubuntu.com/questions/818929/login-ssh-with-ppk-file-on-ubuntu-terminal says, you are not expected to login SSH with .ppk, just only .pem. Though there are some tools to export a .pem from the given .ppk.
e515e8514940ac4117c587dfa50ee86961d47b4c7bc9e753c44a5465d7a6715f
['a76cf138c93e446e9f60337bbf18e254']
Stack Elastic Beanstalk AWS Route 53 for DNS. AWS Certificate Manager for SSL Cert. What I have done I have added the CNAME for the certificate (Through the wizard provided by AWS for Route 53). I have added an inbound rule on the load balancer where the source is anywhere and the port is https(443). I have added both the www and non-www domains when generating the certificate. What works Going to http://example.com works. What doesn't work Going to https://exmaple.com throws ERR_CONNECTION_REFUSED. This leads me to believe my Load Balancer Security Group entry is incorrect. Questions How do I correctly assign my ACM Certificate to my Elastic Beanstalk load balance Security Group? Is there something that I am missing? How long does it take for a change to the security group to resolve?
5308812d37bbc6ca41f9721333610908521754324a14e2594b34dce495f8302a
['a76cf138c93e446e9f60337bbf18e254']
I am trying to setup Rmail to read my Gmail account. I have tried following the instructions on emacswiki: (setenv "MAILHOST" "pop3server") (setq rmail-primary-inbox-list '("po:username") rmail-pop-password-required t) and the ones on the info page http://www.gnu.org/software/emacs/manual/html_node/emacs/Remote-Mailboxes.html (setq rmail-primary-inbox-list '("pop://email:<EMAIL_ADDRESS>")) But both cases behave the same. When I enter Rmail (M-x Rmail), the minibuffer shows Getting mail from the remote server... For 30 seconds - 1 min, after which it simply says: No Mail
cd991c70055c9796549bc785700323d4208fb6abf8b68c51d9a33a7fb9dcb0cb
['a772249ccbd74049ab99da5e0d6482e3']
For an alternative try using Gnumeric (sudo apt-get install gnumeric). Once you have data entered ready to export, go to Data->Export Data->Export into Other Format. You can then choose either a LaTeX table fragment (just the data rows with & separators and \\ line endings) or a full LaTeX document with lots of parameters set by Gnumeric, and the table inserted.
9627671339882ed0b161ceaaddd74613cdc71d6542feb5990144786e552838f8
['a772249ccbd74049ab99da5e0d6482e3']
I'm using the psql command \copy and I would like to pass a variable to it from the shell (for table name) like I've done when scripting queries. I've read in the documentation that: The syntax of the command is similar to that of the SQL COPY command. Note that, because of this, special parsing rules apply to the \copy command. In particular, the variable substitution rules and backslash escapes do not apply. This seems quite definitive, however I'm wondering if anyone knows of a workaroud?
a13411982855df54c2961511ef0400e1a19f5d583dc4c75536301d583169aafd
['a7779ae449994d4d88c80d11d7638285']
Such a solution works for me. numbers = list() for i in range(0, 3): inputNr = int(input("Enter a number: ")) if(inputNr == -99): break numbers.append(inputNr) #Then we take all of the numbers and calculate the sum and avg on them sum = 0 for j, val in enumerate(numbers): sum += val print("The total sum is: " + str(sum)) print("The avg is: " + str(sum / len(numbers)))
3eb4a6429f7220141bb4cddc09c797431e6d5971e7d5d437d2244170bcd374fc
['a7779ae449994d4d88c80d11d7638285']
I have written a program in which I want to request a website to read but the program causes a certificate problem and I couldn't solve.Though I have searched and read some article but I find nothing. I think my problem is unique.Thanks. import bs4 as bs import urllib.request sauce = urllib.request.urlopen('https://stackoverflow.com/').read() soup = bs.BeautifulSoup(sauce, 'lxml') for s in soup.find_all('a'): print(s.string)
32e7e4723c900938672e1eb2d2a075293039f33a29513cbd21d900a30d543d8a
['a77c17a9e9994ecea9aba6a6a8b6da87']
Task I want to be able to generate the permutation matrix that splits a 1D array of consecutive numbers (i.e. even, odd, even, odd, even, odd, ...) into a 1D array where the first half are the evens, and the second half are the odds. So (even1, odd1, even2, odd2, even3, odd3) goes to (even1, even2, even3, odd1, odd2, odd3). For example, with N=6, the permutation matrix would be: M = array([1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1]) You can check that multiplying this with M * array([0, 1, 2, 3, 4, 5]) = array([0, 2, 4, 1, 3, 5]). My approach in pseudocode (Full code below.) This is the mathematically correct way to generate this: I = NxN identity matrix for i in [0:N-1]: if i < N/2: shift the 1 in row i by 2*i to the right if i >= N/2: shift the 1 in row i by 2*(i - N/2)+1 to the right You can see how that works to generate M above. Code (Python) I implement the above pseudocode by using numpy array manipulation (this code is copy-and-pasteable): import numpy as np def permutation_matrix(N): N_half = int(N/2) #This is done in order to not repeatedly do int(N/2) on each array slice I = np.identity(N) I_even, I_odd = I[:N_half], I[N_half:] #Split the identity matrix into the top and bottom half, since they have different shifting formulas #Loop through the row indices for i in range(N_half): # Apply method to the first half i_even = 2 * i #Set up the new (shifted) index for the 1 in the row zeros_even = np.zeros(N) #Create a zeros array (will become the new row) zeros_even[i_even] = 1. #Put the 1 in the new location I_even[i] = zeros_even #Replace the row in the array with our new, shifted, row # Apply method to the second half i_odd = (2 * (i - N_half)) + 1 zeros_odd = np.zeros(N) zeros_odd[i_odd] = 1. I_odd[i] = zeros_odd M = np.concatenate((I_even, I_odd), axis=0) return M N = 8 M = permutation_matrix(N) print(M) Output: array([[1., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 1., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 1., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 1., 0.], [0., 1., 0., 0., 0., 0., 0., 0.], [0., 0., 0., 1., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 1., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 1.]]) My issues I have a feeling that there are more efficient ways to do this. To summarise what I am doing to each matrix: Looping through the rows At each row, identify where the 1 needs to be moved to, call it idx Create a separate zeros array, and insert a 1 into index idx Replace the row we are evaluating with our modified zeros array Is it necessary to split the array in two? Is there an Pythonic way to implement two different functions on two halves of the same array without splitting them up? Is there an approach where I can shift the 1s without needing to create a separate zeros array in memory? Do I even need to loop through the rows? Are there more efficient libraries than numpy for this?
301cb1fc9e8759f07143ca5331ba37244db33b46b5b8e5e5e4ea921c4c919ef5
['a77c17a9e9994ecea9aba6a6a8b6da87']
Unless someone figures out a hack, it's doubtful you can. I'm assuming the PS4 save system is similar to the PS3 save system, and they are encrypted. When I looked into transferring console save files for the older Bethesda games, it was close to impossible for the PS3 (like with Oblivion, Fallout 3) whereas it was much easier for the 360 version (the 360 and PC versions of Bethesda games had compatible/similar save systems). I found some posts on another forum that it was possible for the PS3, but you had to send your save files to some guy who would do it for you (he had a hacked PS3 and some custom decryption software). So, short answer is probably no, unless Bethesda creates a PS4-to-PC save transfer system. It might be in the realm of possibility since they are allowing mods to work with PS4 version of Fallout 4, but I wouldn't hold your breath. If I were you, I'd just look to see if you can use the console in the PC version and cheat your way back to a similar point in the game, by giving yourself the skills, level and items, etc, that you had on the PS4. If the Fallout 4 console also has a complete quest command (like in Oblvion and Skyrim PC versions), you can also auto-complete the quests you've already done in your PS4 version. You'll have to find the quest ID number, too, and that's another command. Again, I don't know yet if Fallout 4 PC has the quest-related console commands, so you'll have to check.
c3dcb5924b33d68ed6df74b3da094d9e8728a5332c2731c5caec733050cdfe68
['a7839145517443caa870ed3b067f6eb7']
I have a php mail() that works just fine. But when I try to add a for loop in the HTML content to replicate the data n time I need, It just gives a blank mail. My code goes as : $to = $email; $from = '<EMAIL_ADDRESS>'; $fromName = 'site name'; $subject = "subject goes here"; $htmlContent = ' <table width="640" cellspacing="0" cellpadding="0" border="0" align="left" style="vertical-align: central; background: white;"> <tbody> <tr> '; for($num = 1; $num <= 3; $num++) { ' <td width="30%" bgcolor="#ffffff" align="left" style="font: 13px Arial, sans-serif; text-decoration: none; vertical-align: top; padding: 6px 16px 0 6px; line-height: 18px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff"> <tbody> <tr> <td valign="bottom" align="left" style="vertical-align: left; padding: 4px 6px 4px 6px;"> <a href="" target="_blank" data-saferedirecturl=""> <img src="https://ci5.googleusercontent.com/proxy/zZrFmHNgHyBIZxLE-YgAoaSXo3azfzJOrKm6F_o7OrDOzp9-bCDcU6ycfbAHWRHUBWPkJDu33r2UcOn7iTZ4KiMnw2ukGVh3CMLatAX1kg-hF1hIeKt9WFSukKfN_wKZHkE=s0-d-e1-ft#https://images-eu.ssl-images-amazon.com/images/I/81PeG59W8fL._AC_SR115,115_.jpg" width="115" height="115" alt="Bourge Mens Loire-99 Running Shoes" border="0" class="CToWUd" /> </a> </td> </tr> <tr align="left" style="padding: 0; display: block; line-height: 16px;"> <td align="left"> <span style="font: 13px Arial, sans-serif; text-decoration: none; color: #868686;"> <a href="https://www.amazon.in/gp/r.html?C=I16HQS27WPED&amp;K=3UKDG356NSZ9O&amp;M=urn:rtn:msg:202007280401268c0c8b33b2024157b4ff1cfed740p0eu&amp;R=14QEUUMSABYUR&amp;T=C&amp;U=https%3A%2F%2Fwww.amazon.in%2Fgp%2Fproduct%2FB07QLYVBD5%2Fref%3Dpe_3025041_189395861_pd_te_s_mr_ti%3F_encoding%3DUTF8%26pd_rd_i%3DB07QLYVBD5%26pd_rd_r%3DKCVKENDXQHECNTMTBWK7%26pd_rd_w%3DjGq5W%26pd_rd_wg%3DlS1ag&amp;H=1KJFSIL6U5VSBGX1K9KQZ3Z8KKEA&amp;ref_=pe_3025041_189395861_pd_te_s_mr_ti" style="font: 13px Arial, sans-serif; text-decoration: none; color: #868686;" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://www.amazon.in/gp/r.html?C%3DI16HQS27WPED%26K%3D3UKDG356NSZ9O%26M%3Durn:rtn:msg:202007280401268c0c8b33b2024157b4ff1cfed740p0eu%26R%3D14QEUUMSABYUR%26T%3DC%26U%3Dhttps%253A%252F%252Fwww.amazon.in%252Fgp%252Fproduct%252FB07QLYVBD5%252Fref%253Dpe_3025041_189395861_pd_te_s_mr_ti%253F_encoding%253DUTF8%2526pd_rd_i%253DB07QLYVBD5%2526pd_rd_r%253DKCVKENDXQHECNTMTBWK7%2526pd_rd_w%253DjGq5W%2526pd_rd_wg%253DlS1ag%26H%3D1KJFSIL6U5VSBGX1K9KQZ3Z8KKEA%26ref_%3Dpe_3025041_189395861_pd_te_s_mr_ti&amp;source=gmail&amp;ust=1596092101507000&amp;usg=AFQjCNHNa6zlhX3HN9z7bHYgdFFUaOEZkQ" > Bourge Mens Loire-99 Running Shoes </a> </span> </td> </tr> <tr align="left" style="padding: 0; display: block; line-height: 16px;"> <td valign="middle" align="left"> <span style="font: 13px Arial, sans-serif; text-decoration: none; color: #868686; vertical-align: 3px;"> Rs. 629.00 </span> <span style="vertical-align: 0px;"></span> </td> </tr> </tbody> </table> </td> '; } ' </tr> </tbody> </table> '; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: '.$fromName.'<'.$from.'>' . "\r\n"; if(mail($to, $subject, $htmlContent, $headers)){ header("location:index?alert=mailsent"); }else{ header("location:index"); } php mail() that works just fine. But when I try to add a for loop in the HTML content to replicate the data n time I need, It just gives a blank mail. Any help is greatly appreciated.
67873313ac7092032b54f8249ed1abd2fa7b13ef4d4aef2114e4f3aebd20bad0
['a7839145517443caa870ed3b067f6eb7']
I m trying to create an webapp with file upload possibility. I have gone through some queries listed in StackOverflow as well for solution no this like File Upload in WebView However when applied the same in my mainactivity, couldn't resolve some errors showing with red underlines. Here's my MainActivity.java: package com.pack.packname; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; import android.os.Handler; public class MainActivity extends AppCompatActivity { private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView = findViewById(R.id.webviewid); webView.setWebViewClient(new WebViewClient()); webView.loadUrl("http://google.com/"); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webView.getSettings().setDomStorageEnabled(true); } private boolean doubleBackToExitPressedOnce = false; @Override protected void onResume() { super.onResume(); // .... other stuff in my onResume .... this.doubleBackToExitPressedOnce = false; } @Override public void onBackPressed() { if (doubleBackToExitPressedOnce) { super.onBackPressed(); return; } if(webView.canGoBack()){ webView.goBack(); } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, "Press again to exit", Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce=false; } }, 2000); } public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) { protected class CustomWebChromeClient extends WebChromeClient { // For Android 3.0+ public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) { context.mUploadMessage = uploadMsg; Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.addCategory(Intent.CATEGORY_OPENABLE); i.setType("image/*"); context.startActivityForResult(Intent.createChooser(i, "File Chooser"), MainActivity.FILECHOOSER_RESULTCODE); } // For Android < 3.0 public void openFileChooser(ValueCallback<Uri> uploadMsg) { openFileChooser(uploadMsg, ""); } } } } I have added an image as well to check the errors that are causing as well. Any help is greatly appreciated..
b3c0be956077ba9be5a1fb1a2c97361c63aefe51fbc6ff8706cc14fbabc5a2ac
['a789664cf26342a6991a1637fb878b56']
I think you should be looking at this Problem from another point of view. The Arduino is capable of supplying 40mA and you want your LEDs to be in parallel. This means you want each branch to draw 10mA. You should absolutely put a 500 Ohm resistor on each branch, a bit more to stay on the safe side. Using a single 213 Ohm resistor will limit the circuit current to 23.5 mA and your LEDs won't be powered properly. To answer your question, the resistor doesn't use the current, it limits the maximum value of current flowing in the circuit and a voltage drops on it.
68b3ee1d10fc1b83c4143bb8b2506987b29fcc8894fb10629ba9b6c1636db813
['a789664cf26342a6991a1637fb878b56']
Hi, I have a question on how I would go about to show an Ajaxloader .gif until a page is loaded. The trick for me is that; The page currently is built so that the page loads one time, I have a tab system, so it loads everything, and then go between the divs. Because this site is made so that even users with low bandwidth can enter it, you have to click "Load gallery" for the page to start loading the thumbnails. So what I'm looking for now is; How do I display a Ajaxload where the gallery is supposed to be, from when a user clicks on the "load gallery" and until all the thumbnails are loaded? Thanks in advance, <PERSON>
7a9a5dde0f81f98dc3383a19c3375d05115977c0b2ce4b9097bbde323b4cb0fe
['a79047d62ee04afe8d7a4230bdf8f6cb']
how can i remove %0A from this string :- this is enter key code, which i need to remove from entire string. so how can i do this? input:- "NA%0A%0AJKhell this is test %0A" Output:- <PERSON> this is test i have tried String input = "NA%0A%0AJKhell this is test %0A"; String output = input.replaceAll("%0A",""); but still not get the output.
0a1f73eec22efcd154021c71e328592c647441de725f6347473e64183d2a5215
['a79047d62ee04afe8d7a4230bdf8f6cb']
Hello i am having a problem in setting the image in relative layout.The problem is that when i set the image with respect to the bottom there is margin left on top of layout and when i set the image to the top there is margin left at the bottom.I am using a scroll view in the layout. code: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="top" android:background="@drawable/layout5_background" > <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" > <Button android:id="@+id/layout5_imgbtn_stopbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/layout5_imgv_clock" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" android:background="@drawable/layout5_stopbutton" /> <ImageView android:id="@+id/layout5_imgv_board" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:src="@drawable/layout5_board" /> <ImageView android:id="@+id/layout5_imgv_wood" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginBottom="20dp" android:src="@drawable/layout5_wood" /> <ImageView android:id="@+id/layout5_imgv_clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/layout5_imgv_wood" android:layout_centerHorizontal="true" android:src="@drawable/layout5_clock" /> </RelativeLayout> </ScrollView>
2d0e1d09393ff8ac5a2b5c63bc4f8ca4ec6c8a7d114304ee6a2ec4e2ca8f6dbc
['a79cdcee81ba4506b0d5edcf604d4117']
I am about to do clustering with feature vectors of 1000 dimension. that is, feature vectors are like the below. a = {255, 2334, 436, ... , 5284}; b = {235, 434, 63, ... , 844}; ... I have also the metric to measure the distance between 2 feature vectors. but i cant figure out which clustering algorithm does clustering with this feature vectors the best because i cant visualize the distribution of these vectors due to high dimension. Anyone knows the method which can visualize these distribution, or in condition of not knowing the distribution of data, how to select the best clustering algorithm? Thanks in advance.
82492607fb89ac54d2faeab5f4e7933036c48207786afc67bcd12b94e5b4f965
['a79cdcee81ba4506b0d5edcf604d4117']
I am implementing the integral image calculation module using CUDA to improve performance. But its speed slower than the CPU module. Please let me know what i did wrong. cuda kernels and host code follow. And also, another problem is... In the kernel SumH, using texture memory is slower than global one, imageTexture was defined as below. texture<unsigned char, 1> imageTexture; cudaBindTexture(0, imageTexture, pbImage); // kernels to scan the image horizontally and vertically. __global__ void SumH(unsigned char* pbImage, int* pnIntImage, __int64* pn64SqrIntImage, float rVSpan, int nWidth) { int nStartY, nEndY, nIdx; if (!threadIdx.x) { nStartY = 1; } else nStartY = (int)(threadIdx.x * rVSpan); nEndY = (int)((threadIdx.x + 1) * rVSpan); for (int i = nStartY; i < nEndY; i ++) { for (int j = 1; j < nWidth; j ++) { nIdx = i * nWidth + j; pnIntImage[nIdx] = pnIntImage[nIdx - 1] + pbImage[nIdx - nWidth - i]; pn64SqrIntImage[nIdx] = pn64SqrIntImage[nIdx - 1] + pbImage[nIdx - nWidth - i] * pbImage[nIdx - nWidth - i]; //pnIntImage[nIdx] = pnIntImage[nIdx - 1] + tex1Dfetch(imageTexture, nIdx - nWidth - i); //pn64SqrIntImage[nIdx] = pn64SqrIntImage[nIdx - 1] + tex1Dfetch(imageTexture, nIdx - nWidth - i) * tex1Dfetch(imageTexture, nIdx - nWidth - i); } } } __global__ void SumV(unsigned char* pbImage, int* pnIntImage, __int64* pn64SqrIntImage, float rHSpan, int nHeight, int nWidth) { int nStartX, nEndX, nIdx; if (!threadIdx.x) { nStartX = 1; } else nStartX = (int)(threadIdx.x * rHSpan); nEndX = (int)((threadIdx.x + 1) * rHSpan); for (int i = 1; i < nHeight; i ++) { for (int j = nStartX; j < nEndX; j ++) { nIdx = i * nWidth + j; pnIntImage[nIdx] = pnIntImage[nIdx - nWidth] + pnIntImage[nIdx]; pn64SqrIntImage[nIdx] = pn64SqrIntImage[nIdx - nWidth] + pn64SqrIntImage[nIdx]; } } } // host code int nW = image_width; int nH = image_height; unsigned char* pbImage; int* pnIntImage; __int64* pn64SqrIntImage; cudaMallocManaged(&pbImage, nH * nW); // assign image gray values to pbimage cudaMallocManaged(&pnIntImage, sizeof(int) * (nH + 1) * (nW + 1)); cudaMallocManaged(&pn64SqrIntImage, sizeof(__int64) * (nH + 1) * (nW + 1)); float rHSpan, rVSpan; int nHThreadNum, nVThreadNum; if (nW + 1 <= 1024) { rHSpan = 1; nVThreadNum = nW + 1; } else { rHSpan = (float)(nW + 1) / 1024; nVThreadNum = 1024; } if (nH + 1 <= 1024) { rVSpan = 1; nHThreadNum = nH + 1; } else { rVSpan = (float)(nH + 1) / 1024; nHThreadNum = 1024; } SumH<<<1, nHThreadNum>>>(pbImage, pnIntImage, pn64SqrIntImage, rVSpan, nW + 1); cudaDeviceSynchronize(); SumV<<<1, nVThreadNum>>>(pbImage, pnIntImage, pn64SqrIntImage, rHSpan, nH + 1, nW + 1); cudaDeviceSynchronize();
11f706714a471878efab40605a5acbdc0219dabf8f6fa705c8299384b58c2751
['a7a5765d5e0340e5ab4b10a63c0bcf19']
I've ported c# code used to work against smtp.google.com:587 to work via office365 without success. Tried all combinations of Credential before/after using Ssl and almost every recommendation made on the Internet - w/o success (got 5.7.1 .... error). Finally got this line from somewhere as last resort, just before .Send(message) smtpClient.TargetName = "STARTTLS/smtp.office365.com"; Since then - every send() is big success.
ba7a22b6b86ae6090e8f086e965a98daa90a7ac0a5d83db2cb8e39e674a16271
['a7a5765d5e0340e5ab4b10a63c0bcf19']
I have an MVC application that makes calls to google to validate its users. It seems that it uses deprecated protocol (by Google) OpenId. Is there any simple configuration steps to make MVC 4 to use OAuth2 instead of OpenId? My problem: receive err message: "OpenID auth request contains an unregistered domain: http://mydomain " on every call to OAuthWebSecurity.RequestAuthentication() or OAuthWebSecurity.VerifyAuthentication()
5240475c97aa2fab72d22daf26d389ad9d88a29d788f396edcc8a67655ae4322
['a7a6faae681741ba8d6a693b1ae92dbe']
I am trying to create a method that returns all the data of a column so that data can be used on a listview to populate it. public static Array populatelistview() { OleDbConnection myConnection = GetConnection(); string query = "SELECT * FROM trainlines_"; OleDbCommand command = new OleDbCommand(query, myConnection); command.Connection = myConnection; DataSet trainlinedata = new DataSet(); trainlinedata.Clear(); OleDbDataAdapter datareader = new OleDbDataAdapter(command); datareader.Fill(trainlinedata); myConnection.Close(); return trainlinedata; }
e91ee157e4dc1068b40373521bcecd8e7e129acf320beca9d723d5606b9187d7
['a7a6faae681741ba8d6a693b1ae92dbe']
I am trying to create a login page using SQlite. However, for some reason I have been getting error ( Fatal error: Uncaught Error: Call to a member function fetch() on boolean in C:\xampp\htdocs\project\login.php:20 Stack trace: #0 {main} thrown in C:\xampp\htdocs\project\login.php on line 20) <?php include("config.php"); session_start(); $error = ""; if(@$_SESSION['login_user'] != null){ header("location: dashboard.php"); } if(!empty($_POST['username']) && !empty($_POST['password'])) { // username and password sent from form $myusername = strtolower($_POST['username']); $mypassword = $_POST['password']; $dir = 'sqlite:db.sqlite3'; $dbh = new PDO($dir) or die("cannot open the database"); $sql = "SELECT username, password FROM users_ WHERE username = '$myusername' and password = '$mypassword'"; $result = $dbh->query($sql); $row = $result->fetch(); echo $row['username']; echo $row['password']; } ?>
404018929f3cfe98f6552b24185bb53ea3d023c061ff86fe9742b765c42c5475
['a7aad7f215664552ab54a3d105004ade']
See: https://cloud.google.com/bigquery/docs/manually-changing-schemas#deleting_a_column_from_a_table_schema There are two ways to manually delete a column: Using a SQL query — Choose this option if you are more concerned about simplicity and ease of use, and you are less concerned about costs. Recreating the table — Choose this option if you are more concerned about costs, and you are less concerned about simplicity and ease of use.
0a610f1f76b327a5291bc439b915fe120fdadb06a506458d7509a7b7167e907e
['a7aad7f215664552ab54a3d105004ade']
You should run deploy command in directory that your index.js exists. In case of the following page, it named helloWorld. https://github.com/GoogleCloudPlatform/cloud-functions-emulator/ . └── helloWorld └── index.js cd helloWorld functions-emulator start functions-emulator deploy helloWorld --trigger-http functions-emulator call helloWorld functions-emulator logs read functions-emulator stop
682d7041da2b6287b3c4d1a960eb09950ee38c6806d98c3d610823d3e7436d5f
['a7ae0575bc7d418eb965b7656d546210']
Update your ID values to 'totwsilversbar1' (menu 4) and 'totwsilversbar2' (menu 5), respectively. And change your css as follows: #totwsilversbar1 { width: 100% !important; height: 210px !important; position: relative !important; left: -705px;} #totwsilversbar2 { width: 100% !important; height: 210px !important; position: relative !important; left: -940px;} JS Fiddle : https://jsfiddle.net/h5ek2wpm/10/
fd906a63fab88cac69f5cacf6e4e74e93c982978e9d89562826a7d0e400c4677
['a7ae0575bc7d418eb965b7656d546210']
I have an assignment problem as a part of my Master's Thesis, and I am looking for general direction in solving the same. So, there is a list of agents, and a list of tasks, with number of tasks being greater than the number of agents. The agents submit a prioritized ordered list of tasks they can/want to do. The length of the list is fixed to a number much smaller than the total number of tasks. Every agent must be assigned a task. A task once assigned cannot be assigned to another agent. The objective is to find an assignment such that the average priority/preference of the assigned tasks is the lowest. Additionally, if it is complete solution i.e. every agent is assigned a task, it is even better. I have looked at the generalized assignment problems, and the Hungarian algorithm, but these do not cater to the specific situation where there is a cost to a task and also the possibility of the agent being unable to do some of the tasks. Please help. Thank you.
81a4675a3cb7d8a9ec4b0b7df8e08ef08fa027549590cfaa8cb6a416f76af34e
['a7afce07293247829884e5de053e4bad']
Everyone. I've got the following AJAX to load a table: <script> function loadtable(){ $( '#table1').load('tablerow.php #table1'); } </script> <table name="table1" id="table1" class="center" onload="loadtable();"> <tbody> <tr><th>DSA #</th><th>Plan</th><th>Initial Plan?</th><th>DDD#</th><th>Program</th><th>Consumer<br>Name</th><th>Coordinator<br>Name</th><th>PEA Upload<br>Date</th><th>DOB</th><th>Plan Approval<br>Date</th><th>DS&A Start<br>Date</th><th>Plan Start<br>Date</th><th>Plan End<br>Date</th><th style="width:100px;">Action</th><th>Link to MTs</th></tr> <?php $n = 0; $mp = 0; $id = 0; while($row = mysqli_fetch_assoc($rs)) { include 'tablerow.php'; //this line draws the rows and sets up the $id variable. tablerow.php does all the heavy lifting. I use includes instead of other functions here because it keeps the code cleaner, and because my experimentation with HEREDOC showed that it would fragment the file more if I did it that way. -- BH $id++; } ?> </tbody> </table> tablerow.php looks like this: <tr> <?php error_reporting(E_ALL); ini_set('display_errors', 1); $AD = $row['Approval_Date']; $Program = $row['Program']; $DOB = $row['DOB']; $Plan_Approval_Date = $row['Plan_Approval_Date']; $Last_Name = $row['Last_Name']; $First_Name = $row['First_Name']; $DDD_Case = $row['DDD_Case']; $Initial_Plan = $row['Initial_Plan1']; $Plan = $row['Plan']; $Client_ID = $row['Client_ID']; $DSA_ID = $row['DSA_ID']; $UID = $DDD_Case . "_" . $Plan; if (strtotime($row['Plan_Approval_Date']) > strtotime($row['Approval_Date'])) { $Approval_Date = $row['Plan_Approval_Date']; } else{ $Approval_Date = $row['Approval_Date']; } if($Approval_Date <> '') { $Plan_End_Date = date('m/d/Y', strtotime('+364 days', strtotime($Approval_Date))); } else { $Plan_End_Date = ''; } ?> <script> function submitrecord<?php echo $id; ?>() { pln = document.forms["b<?php echo $id; ?>"]["Plan"]; /* Plan */ mdate = document.forms["b<?php echo $id; ?>"]["Medicaid_Date"]; /* Medicaid Date */ prog = document.forms["b<?php echo $id; ?>"]["Program"]; /* Program */ pad = document.forms["b<?php echo $id; ?>"]["Plan_Approval_Date"]; /* Plan Approval Date */ ip = document.forms["b<?php echo $id; ?>"]["Initial_Plan"]; /* Initial Plan */ pea = document.forms["b<?php echo $id; ?>"]["PEA_Update"]; /* PEA Date */ ad = document.forms["b<?php echo $id; ?>"]["Approval_Date"]; /* Plan Start Date */ ped = document.forms["b<?php echo $id; ?>"]["Plan_End_Date"]; /* Plan Start Date */ var dte = pad.value; var dt1 = new Date(dte); var dte2 = ped.value; var dt2 = new Date(dte2); //alert(dte); //alert(dte2); if(dt2 < dt1){alert("End date is before start date. Please correct this!"); return(1); } /* This code checks to see if the Plan number and the Initial Plan status are the same as the database. If it is, all's clear, and it's submitted. */ /* This code checks to see if it's not a CCP-Short and the Program is filled in. */ // alert("At least it runs."); if(prog.value ==''){ event.preventDefault();alert('Program is blank! This should not be.'); return(1); } if(pad.value ==''){ event.preventDefault();alert('Plan Approval Date is blank! This should not be.'); return(1); } if(ip.value == '1'){ /*if(mdate.value == '') {event.preventDefault();alert('Medicaid Start Date is blank! This should not be.'); return(1);}*/ if(pea.value == '' && (prog.value == 'CCP' || prog.value == 'Supports')) // if PEA date is blank and Program is CCP or Supports { event.preventDefault();alert('PEA Date is blank! This should not be.'); return(1); } if(pad.value == '') { event.preventDefault();alert('Plan Approval Date is blank! This should not be.'); return(1); } } if(ip.value == '1'){ if(prog.value == 'CCP-Short' && ped.value =='') { event.preventDefault();alert('Plan End Date is blank! This should not be.'); } if(ad.value == '') { event.preventDefault();alert('Plan End Date is blank! This should not be.'); return(1); } } document.getElementById('b<?php echo $id ?>').submit(); } </script> <form id="b<?php echo $id; ?>" method="POST" action="planupdate.php?DSA_ID=<?php echo $DSA_ID; ?>"> <input id="DSA_ID<?php echo $id;?>" name="DSA_ID" value="<?php echo $DSA_ID; ?>" type="hidden"> <td><input id="Client_ID<?php echo $id; ?>" type="text" size="5" name="Client_ID" class="Client_ID" value="<?php echo $row['Client_ID']; ?>" readonly></td> <td><input form ="b<?php echo $id; ?>" id="Plan" type="text" name="Plan" size="4" class="Plan" value="<?php echo $row['Plan']; ?>"></td> <td><select id="Initial_Plan" name="Initial_Plan" class="Initial_Plan"><option <?php if($Initial_Plan == "0"){echo "Selected ";}; ?> value="0">No</option><option <?php if($Initial_Plan == "1"){echo "Selected ";}; ?> value="1">Yes</option></select></td> <td><input id="DDD<?php echo $id; ?>" type="text" size="10" name="DDD_Case" class="DDD_Case" value="<?php echo $DDD_Case; ?>" readonly></td> <td><select required id="Program<?php echo $id; ?>" name="Program" class="Program"><option value = ""></option><option <?php if($Program == "CCP-Short"){echo "Selected ";}; ?>>CCP-Short</option><option <?php if($Program == "CCP"){echo "Selected ";}; ?>>CCP</option><option <?php if($Program == "Interim"){echo "Selected ";}; ?>>Interim</option><option <?php if($Program == "Supports"){echo "Selected ";}; ?>>Supports</option><option <?php if($Program == "E-Record"){echo "Selected ";}; ?>>E-Record</option></select></td> <td><?php echo $First_Name . " " . $Last_Name; ?></td> <td><?php echo $row['SC_FName'] . " " . $row['SC_LName']; ?></td> <td><input id="PEA_Update<?php echo $id; ?>" type="text" size="10" name="PEA_Update" class="PEA_Update" value="<?php echo $row['PEA_Update']; ?>" readonly></td> <td><input id="Medicaid_Date<?php echo $id; ?>" type="text" size="10" name="DOB" class="DOB" value="<?php echo $row['DOB']; ?>" readonly></td> <td><input id="Plan_Approval_Date<?php echo $id; ?>" type="text" size="10" name="Plan_Approval_Date" class="Plan_Approval_Date" value="<?php echo $row['Plan_Approval_Date']; ?>" readonly></td> <td><?php echo $row['Start_Date2']; ?></td> <td><input id="Approval_Date<?php echo $id; ?>" type="text" size="10" name="Approval_Date" class="Approval_Date" value="<?php echo $AD; ?>" readonly></td> <td><input id="Plan_End_Date<?php echo $id; ?>" type="text" size="10" name="Plan_End_Date" class="Plan_End_Date" value="<?php if($row['Plan_End_Date'] <> ''){echo $row['Plan_End_Date'];} else {if($row['Program'] <> 'CCP-Short'){ $Plan_End_Date = date('m/d/Y', strtotime('+ 364 days', strtotime($Plan_Approval_Date))); echo $row['Plan_End_Date']; } }?>"></td> <td><input id="tst<?php echo $id; ?>" form="b<?php echo $id; ?>" value="Update Plan" name="Submit" type="submit" onclick="event.preventDefault();submitrecord<?php echo $id; ?>();"></td> <td><a href='mtool3-session.php?DDD_Case=<?php echo $DDD_Case; ?>&Plan=<?php echo $row['Plan']; ?>'>Link to MTs</a><?php if($Job_Title == 'Administrator' || $Job_Title == 'Administration Manager'){include 'delform.php';} ?> </td> </form> </tr> The problem is, this only works if I reload the page. If I reload when I hit the page, everything is fine, but without that, the table doesn't show up. And the success message is never displayed. I can see the information in the database when I'm done, but the success message never shows up, so I feel like there must be something wrong on the submit end that keeps the information from working correctly, even though it's there. I assume that's why I have to reload the page. Can anyone give me any guidance? Thanks!
3a79d44aebef13ae86ab72352b968ac2f542d85d30ad69881e676b87b5ccdd97
['a7afce07293247829884e5de053e4bad']
Everyone. I got some good help a couple of days ago, so I'm hoping that someone can show me where I'm going wrong here. Basically, what I'm trying to do is update a MySQL database in the background when a user clicks a button. The form is a series of records, and the records have common field names (ID, DSA_Number, Manager_Review, etc.) Right now, the code doesn't even seem to return success or failure messages. Here's the script on the main page: <script> $(document).ready(function(){ $("#button").click(function(){ var DDD_Number=$("#DDD_Number").val(); var Manager_Review=$("#Manager_Review").val(); var RID=$("#RID").val(); var Services=$("Services").val(); var Dues_List=$("Dues_List").val(); var ID=$("ID").val(); var myrid=$("myrid").val(); var Manager_Comments=$("Manager_Comments").val(); var President_Comments=$("President_Comments").val(); var dataTosend='?DDD_Number='+DDD_Number+'&Manager_Review='+Manager_Review+'&RID='+RID+'&Services='+Services+'&Dues_List='+Dues_List+'&Manager_Comments='+Manager_Comments+'&President_Comments='+President_Comments; $.ajax({ type: "GET", url:'baseupdater-test.php' + dataTosend, data:dataTosend, async: true, success:function(data){ document.getElementById('stuffhere').innerHTML.text = "Success."; document.getElementById('stuffhere').innerHTML.text = data; }, error: function(data){ document.getElementById('stuffhere').innerHTML.text = "Failure."; } }); }); </script> Here's the code that draws the rows on the table: <?php /* This code writes the rows in the table for baserecord.php */ $n = 0; $o = $n + 1; $firstday = date('m/1/Y'); if(isset($_GET['MR'])) // If $_GET['MR'] is set ... { $MR = $_GET['MR']; // Set the variables. $PR = $Pres_Rev; } else // If not, select the maximum (latest) Manager Review Date. { $getmr = "select max(STR_TO_DATE(Manager_Review_Date, '%m/%d/%Y')) as Manager_Review_Date, President_Review_Date from clientdb.MRS2_test inner join clients_MRS on clientdb.clients_MRS.DDD_Case = clientdb.MRS2_test.DDD_Number where SCID = '$ID';"; $rs2 = mysqli_query($con,$getmr); $rvd = mysqli_fetch_assoc($rs2); $MR = date('m/d/Y', strtotime($rvd['Manager_Review_Date'])); echo "MR: $MR<br>"; $PR = date('m/d/Y', strtotime($rvd['President_Review_Date'])); } // The following query select the data for the row and orders it by the latest Manager Review Date. $cliselect = "select distinct clientdb.Plans.Client_ID, clientdb.clients_MRS.DSA_Status, clientdb.clients_MRS.DSA_Status_Date, clientdb.clients_MRS.First_Name, clients_MRS.Last_Name, clientdb.clients_MRS.County, clientdb.Plans.DDD_Case, RID, Plans.Program, max(Plans.Plan) as MPlan, Tier, Plan_End_Date, clientdb.MRS2_test.RID, clientdb.MRS2_test.President_Comments, clientdb.MRS2_test.Manager_Comments, clientdb.MRS2_test.Services_Issues, clientdb.MRS2_test.Dues_List from clientdb.Plans inner join clientdb.clients_MRS on clientdb.clients_MRS.DDD_Case = clientdb.Plans.DDD_Case inner join clientdb.MRS2_test on clientdb.MRS2_test.DDD_Number = clientdb.Plans.DDD_Case where SCID = '$ID' and (DSA_Status = 'Active' OR (DSA_Status <> 'Active' AND STR_TO_DATE(DSA_Status_Date, '%d/%m/%Y') > STR_TO_DATE($firstday, '%m/%d/%Y'))) AND (Manager_Review_Date = '$MR') group by clientdb.Plans.DDD_Case order by STR_TO_DATE(clientdb.MRS2_test.Manager_Review_Date, '%m/%d/%Y') DESC, clientdb.Plans.Last_Name;"; //echo "cliselect $cliselect<br>"; $cres = mysqli_query($con, $cliselect); while ($dddr = mysqli_fetch_assoc($cres)) { $DDD_Case = $dddr['DDD_Case']; $First_Name = $dddr['First_Name']; $Last_Name = $dddr['Last_Name']; $County = $dddr['County']; $Tier = $dddr['Tier']; if($ddr['Plan_End_Date'] <> '') { $Plan_End_Date = $dddr['Plan_End_Date']; } $Pres_Comments = $dddr['President_Comments']; $Mgr_Comments = $dddr['Manager_Comments']; $Dues = $dddr['Dues_List']; $Services = $dddr['Services_Issues']; $RID = $dddr['RID']; $mxselect = "select max(Plan) as MPlan from clientdb.Plans where clientdb.Plans.DDD_Case = '$DDD_Case';"; $rens = mysqli_query($con, $mxselect); $rmm = mysqli_fetch_assoc($rens); $MPlan = $rmm['MPlan']; $endsel = "select Plan_End_Date, Program from clientdb.Plans where clientdb.Plans.DDD_Case = $DDD_Case and clientdb.Plans.Plan = $MPlan;"; $rsel = mysqli_query($con, $endsel); $end = mysqli_fetch_assoc($rsel); $Plan_End_Date = $end['Plan_End_Date']; $Program = $end['Program']; //The purpose of ths quer s to get the RID for each row. $mrselect = "select * from MRS2_test where DDD_Number = '$DDD_Case' and Manager_Review_Date = '$MR' group by DDD_Number, RID order by RID DESC Limit 1 ;"; $run = mysqli_query($con,$mrselect); $mrss = mysqli_fetch_assoc($run); $Manager_Review_Date = $mrss['Manager_Review_Date']; $President_Review_Date = $mrss['President_Review_Date']; $myRID = $mrss['RID'][$n]; echo "<tr><td>$o</td><td sorttable_customkey='$DDD_Case'><input class='ddd' type = 'text' value = '$DDD_Case' name = 'DDD_Number[]' size='6'></td><td sorttable_customkey='$Last_Name'>$First_Name $Last_Name</td><td>$County</td><td>$Program</td><td>$Tier</td><td sorttable_customkey='"; ?> <?php echo strtotime($Plan_End_Date); echo "'>$Plan_End_Date</td><td><textarea class='expnd' name='Services[]'>$Services</textarea></td><td><input name='Dues_List[]'' type = 'text' value = '$Dues'></td><td><textarea class='expnd' name='Manager_Comments[]'>$Mgr_Comments</textarea></td><td><textarea class='expnd' name='President_Comments[]'>$Pres_Comments</textarea></td><td><input type='text' size='4' name = 'myrid[]' value='$RID' readonly></td><input type='hidden' name = 'manreview-orig' value='$Manager_Review_Date'></tr>"; $n = $n++; $o++; } ?> And finally, this is the code that does the update: <?php include 'config.php'; $con = mysqli_connect($DB_server, $DB_user, $DB_password, $DB_database); $Manager_Review = $_GET['Manager_Review']; $Old_MR = $_GET['manreview-orig']; //echo "OLD MR: $Old_MR<br>"; if($_GET['President_Review'] == '12/31/1969') { $President_Review = ''; } if($_GET['President_Review'] <> '') { $President_Review = $_GET['President_Review']; } else { $President_Review = ''; } $ID = $_GET['ID']; $Services = $_GET['Services']; echo "New Content!<br>"; $n = 0; while ($n <= sizeof($_GET)) { $ridselect = "select clientdb.MRS2_test.RID, clientdb.clients_MRS.DDD_Case, clientdb.clients_MRS.SCID from clientdb.MRS2_test inner join clientdb.clients_MRS on clientdb.clients_MRS.DDD_Case = clientdb.MRS2_test.DDD_Number where Manager_Review_Date = '$Old_MR' and clientdb.clients_MRS.DDD_Case = clientdb.MRS2_test.DDD_Number order by RID;"; $rsc = mysqli_query($con, $ridselect); $rowrid = mysqli_fetch_assoc($rsc); $RID = $_GET['myrid'][$n]; // echo "RID: $RID<br>"; $MDD = $_GET['RID']; $myrid = $_GET['myrid'][$n]; $DDD_Case = $_GET['DDD_Number'][$n]; $Period = ltrim(substr($Manager_Review,0,2), "0"); $Services = mysqli_real_escape_string($con, $_GET['Services'][$n]); $Manager_Comments = mysqli_real_escape_string($con, $_GET['Manager_Comments'][$n]); $President_Comments = mysqli_real_escape_string($con, $_GET['President_Comments'][$n]); $Dues_List = mysqli_real_escape_string($con, $_GET['Dues_List'][$n]); $DDD_Case = $_GET['DDD_Number'][$n]; $updater = "update clientdb.MRS2_test set clientdb.MRS2_test.Services_Issues = '$Services', clientdb.MRS2_test.Manager_Comments = '$Manager_Comments', clientdb.MRS2_test.President_Comments = '$President_Comments', clientdb.MRS2_test.Dues_List = '$Dues_List', Period = '$Period' where DDD_Number = '$DDD_Case' and RID = '$RID';"; echo $updater . "<br>"; $date_updater = "update clientdb.MRS2_test set clientdb.MRS2_test.Manager_Review_Date = '$Manager_Review', clientdb.MRS2_test.President_Review_Date = '$President_Review' where RID = '$RID';"; echo "dateupdater: $date_updater<br>"; if(!mysqli_query($con, $date_updater)) { echo "That failed miserably.<br>"; } else { $rws = mysqli_affected_rows($con); echo "affected rows: $rws<br>"; echo "Success.<br>"; } mysqli_query($con, $updater); $datestamp = date('Y-m-d h:i:s'); $upstamp = "update clientdb.MRS2_test set Update_Time = '$datestamp' where DDD_Case = '$DDD_Case' and RID = '$RID';"; mysqli_query($con,$upstamp); $n++; } echo "<script language='Javascript'>document.getElementById('stuffhere').InnerHTML = '<?php echo $updater; ?>';</script>"; ?> I've tried serializing the form, and I haven't had any success there. Any suggestions would be greatly welcome. Sorry for the long post, but I'm just not sure where the error is at this point.
0ba70c3fd18785010514cd1bf081021bc6c75dc4527f0e5357c4312b6252d43f
['a7b0c6bd5711479d9db8169dc127e5f6']
in short I want the same functionality as the taxonomy module where you can have an URL like "localhost/drupal/admin/structure/taxonomy/occupational_fields/edit" where occupational_fields was the aliased part. The menu entry in taxonomy for the page callback looks like this: $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/edit'] = array( 'title' => 'Edit', 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_form_vocabulary', 3), 'access arguments' => array('administer taxonomy'), 'type' => MENU_LOCAL_TASK, 'weight' => -10, 'file' => 'taxonomy.admin.inc', ); The function declaration looks like this: function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) Now my implementation looks like this: $items['admin/config/mapper/%tid/edit'] = array( 'title' => 'Mapper edit mapping', 'description' => 'Add or edit a mapping', 'page callback' => 'drupal_get_form', 'page arguments' => array('mapper_form_mappings', 3), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'file' => 'mapper.admin.inc', ); And respectively: function mapper_form_mappings($form, &$form_state, $edit = array()) But when an URL like "localhost/drupal/admin/config/mapper/11/edit" is opened the function above is not called. I tried googling a good URL alias tutorial for module programming, but couldn't find one. Maybe I searched for the wrong thing? edit: I can imagine that I need some type of handler, but I couldn't find one in the taxonomy files and the tutorials didn't mention them either.
5f637c11cfb0abf1be070739a901678e4ba2709711f02803f5350e704cd617b3
['a7b0c6bd5711479d9db8169dc127e5f6']
yea thanks you are right about the typo. I actually also screwed up the -2i/F factor which I changed now in the question. This explains the messed up sign with the energy. Thanks a lot for the response! However, I don't think H|omega> =0, it should equal E_0|omega>.
2085ce59a036c1fa360e4c6d8afc0c433f9bf53eb3239c937d38a55c11cef18a
['a7b276f208964d278d37ed6d25133834']
Is there any aspect ratio that needs to be considered for full background responsive image? Image size is 1361 x 1216. Original Image Below is the CSS used, body{ background-image:url('../images/bg-img.jpg'); background-position:center center; background-repeat:no-repeat; background-attachment:fixed; background-size: contain; } But the result is background-size: contain If background-size: cover is used the top and bottom portion of the image are cropped.
1c02e4189eb1dd89304cebce22a95cff4f7652045e0dc761a6e4eef6ac00383e
['a7b276f208964d278d37ed6d25133834']
I'm trying to insert url for menu through mustache template. But just the first value is being returned for the array. Or is this the return method wrong var main_menu_link = ["main_dashboard.html", "#", "online_dashboard.html","index.html","#","#","#"]; var url = ""; var i; var url_link=""; for(i = 0; i < main_menu_link.length; i++) { url += main_menu_link[i]; return '<a href="'+ url +'">' + text + '</a>'; } CodePen working here
fd8e3d310f41917f0db369b2376147a91e1c760d8ff8e196429aa3279510ac55
['a7ba3988234f40c5b72cc2d17fb443bf']
I'm trying to create a trigger for my 'rentals' table that will change the value in a certain column ('rent_avail') from another table when an update occurs in the former table. The idea is simple: when a dvd is returned to the dvd store (i.e. date_return has a date value, the dvd has now become available again for renting. Thus, my 'rent_avail' column for the record (dvd) in question should reflect this by being set to 'Y' (the alternative is 'null' when the dvd is currently being rented out). My trigger is being created without errors, but after an insert on the date_return column, all values in my DVD table are being changed. I want to know how can I simply modify the column values in 'rent_avail' column in my dvd table for only the row being updated! This is probably very trivial, but I have researched it and can't seem to find a solution easily.. CREATE OR REPLACE TRIGGER RENTAL_RETURNS AFTER UPDATE OF DATE_RETURN ON RENTAL FOR EACH ROW BEGIN IF :OLD.DATE.RETURN IS NULL AND :NEW.DATE_RETURN IS NOT NULL THEN UPDATE DVD SET RENT_AVAIL = 'Y' WHERE DVD.DVD_ID = DVD_ID; END IF; END; /
a920af75e52b6436dc96f00e0b42f4899bdab972ad559b53361fa03df57d4660
['a7ba3988234f40c5b72cc2d17fb443bf']
Can anyone help me understand why the result of VSIZE function in my PL/SQL queries differs when I run the command on its own in the SQL plus command line and when I use it in a procedure? I understand that VSIZE displays the number of bytes in the internal representation of the expression. I've looked through many examples, and in the following example, I'm fairly sure I should get an answer lower than what I'm getting (around 12) when I run it as part of a procedure? Why isn't the answer identical in both cases, if the trim function is used on both? I need to return the number of bytes in the input (which is a full name), and so I remove trailing spaces before I invoke VSIZE. The difference in output is observed between the following two queries: SELECT VSIZE( trim(' <PERSON> ')) from dual; and... CREATE OR REPLACE PROCEDURE HelloFullName (fullname IN NVARCHAR2) IS fullname_mod NVARCHAR2(50); BEGIN SELECT (INITCAP(TRIM(fullname)) into fullname_mod from dual; DBMS_OUTPUT.PUT_LINE('Initial-capitalized version of name: ' || fullname_mod); SELECT VSIZE( (trim(fullname) INTO fullname_mod from dual; DBMS_OUTPUT.PUT_LINE('Number of bytes in name: ' || fullname_mod); END HelloFullName; / BEGIN HelloFullName(' <PERSON>); END; / I am still new to PL/SQL, and would appreciate any insights...Cheers
2d3ad79b60b8ece0929428a0214c24b78545dedd93d0bbf4f5662edf4e054b28
['a7c328ae8fe6400f95d603c98db7a7b1']
Alrighty! Figured it out. Thanks, everyone for the answers, however, this is for a front-end author page, not backend access. // remove wooCommerce redirect from authors.php template remove_action('template_redirect', 'wc_disable_author_archives_for_customers', 10 ); Turns out WooCommerce disables author archives for customers. In my case, a customer is also a member and therefore I need to author.php template accessible.
d680e3122ec73e4241a462b2e9d39e18f2b6cc2b00f58a12a82da78bb19d93c7
['a7c328ae8fe6400f95d603c98db7a7b1']
I see a couple things to try. First, make sure to set your custom js file to have 'slick-js' as a dependancy. This way it loads after slick slider does. Also, jquery is already part of wordpress, so you do not need to enque it again. However, it should be a dependancy for both your custom script and slick: wp_enqueue_script('main', get_stylesheet_directory_uri() . '/js/custom.js', array('slick-js', 'jquery'), NULL, true ) ; Second, I'm not sure what val-slider is, but it could be conflicting with slick slider. I suggest only using one javascript slider for your theme. Slick is very powerful and customizable, so It's a good choice. Third, slick slider typically also has a theme-styles.css file that you should include. This pretties up the slider and puts arrows/dots in the right place. Fourth, I'm not sure what your HTML looks like, but make sure the div with class .slideshow is the immediate parent to your slides (typically a for or foreach loop.) If there is another surrounding div in there then slick will interpret that as one slide. Here's an example: <div class="slideshow"> <?php foreach($slides as $slide) { echo '<div class="slide">'; //this class name is unimportant //slide content here echo '</div>'; }; ?> </div> Fifth, not sure if this is a copy/paste error but you're missing the closing )}; in your javascript. Last thing, this wont break slick slider, but it could cause some weird things to happen; you have slidesToScroll: 10 but are only showing one slide slidesToShow:1. I think it's a good practice to make these numbers the same.
c4166339861abd5b6a07e5a44095096500871006e34fc64427f63d253022228b
['a7ca75dea36044b78077b240177f346a']
I m studying p-adic gauss sums and when reading a paper about them I found that those kind of sums are defining in local rings and give the example of Z/(P^l)Z .I looked for the definition of such rings i.e local rings and I found that are rings which posses one maximal ideal ring that is why I m asking what is the unique maximal ring of Z/(P^l)Z
79ed1b82232f8f0a685d97a4d1753887dcc5c5c318de2756b1dff78621275267
['a7ca75dea36044b78077b240177f346a']
I don't know each library you are using. But most ML libraries have model optimizers built in to help you with this task. For instance, if you using sklearn, you can use RandomizedSearchCV to look for a good combination of hyperparameters for you. For instance, if you training a Random Forest classifier": #model MOD = RandomForestClassifier() #Implemente RandomSearchCV m_params = { "RF": { "n_estimators" : np.linspace(2, 500, 500, dtype = "int"), "max_depth": [5, 20, 30, None], "min_samples_split": np.linspace(2, 50, 50, dtype = "int"), "max_features": ["sqrt", "log2",10, 20, None], "oob_score": [True], "bootstrap": [True] }, } scoreFunction = {"recall": "recall", "precision": "precision"} random_search = RandomizedSearchCV(MOD, param_distributions = m_params[model], n_iter = 20, scoring = scoreFunction, refit = "recall", return_train_score = True, random_state = 42, cv = 5, verbose = 1 + int(log)) #trains and optimizes the model random_search.fit(x_train, y_train) #recover the best model MOD = random_search.best_estimator_ Note that the parameters scoring and refit will tell the RandomizedSerachCV which metrics you are most interested in maximizing. This method will also save you the time of hand tuning (and potentially overfitting your model on your test data). Good luck!
143d6adf4ef3381f5be01c7736527b3af0fb411282062626a29d55b95caf274a
['a7d525755dbb49619a090685a7be1700']
I'm not sure exactly why you're doing this either, but I have a guess that may help you. You can set the output folder for dlls within Visual Studio. You get to the screen below by right clicking on your project and selecting Properties. Then select the Build tab. Change the output path from bin\ to bin\Debug. Or, if I'm guessing correctly at your real problem and you have projects outputting to bin\Debug and don't know how to change that, you can change it back from bin\Debug to just bin\.
6ffeb186306f817e817b61af0e5061a90acd8da8bcd564a17d62625c09b20887
['a7d525755dbb49619a090685a7be1700']
Its not a great solution, but I've gotten around this before at the page level by adding a querystring to the end of the call to the CSS file: <link href="/css/global.css?id=3939" type="text/css" rel="stylesheet" /> Then I'd randomize the id value so that it always loads a different value on page load. Then I'd take this code out before pushing to production. I suppose you could also pull the value from a config file, so that it only has to be loaded once per commit.
ac1622b319458a3d3661f98198230b3ff914db0c28b2eb5023097445707338f1
['a7fb9c7fc25a49408541785b7da02499']
I'm using the Mern stack, but I'm having an issue as to where to save uploaded files. Let me explain. I have a form that sends over a formdata which includes a .jpg image. On Node/express side, I receive it well. But now I'm stuck. I'm using express-fileupload package which attaches an mv function that allows me to store my file in a directory. In my endpoint, I have this snippet: const img1= req.files.image1; const img1Name = img1.name; img1.mv("NOT-SURE-WHERE-TO-MAKE-MY-DIRECTORY"+img1Name, (err) => { if (err) { return res.status(500).json({message: 'Could Not mv file'}); } else { return res.status(200).json({message: 'mv done'}); } }) Where do I create the directory to store the .jpg image? Do I create it in the client's src? or client's public? Or, do I run the npm-run-build command to create my build folder and then point my mv function to save the file in there?
67a8becb58cb40dcbbd587c2d9136f13f1b47d732886a23d6711de26203846f2
['a7fb9c7fc25a49408541785b7da02499']
i keep getting a null value from my reactive form. The field name is "from" my ts file ngOnInit() { this.createForm = new FormGroup({ 'title': new FormControl(null, [ Validators.required, Validators.maxLength(40) ]), 'message': new FormControl(null, [ Validators.required, Validators.maxLength(130) ]), 'from': new FormControl(null, Validators.maxLength(40) ) }); } my form <form [formGroup]="createForm" (ngSubmit)="onSubmit()"> <div class="form-group"> <label for="">Food Item</label> <input type="text" class="form-control" placeholder="Bacon Egg & Cheese Sandwich" maxlength="40" formControlName="title" > </div> <div class="form-group"> <label for="">Customer Message to Recepient</label> <textarea class="form-control" rows="4" maxlength="130" formControlName="message"></textarea> </div> <div class="form-group"> <label for="">Customers Name</label><br> <input type="text" class="form-control" placeholder="Anonymous" maxlength="40" formControlName="from" > <small class="text-muted">Leave Blank for Anonymous</small> </div> <button class="btn btn-success">Create</button> </form> in my onSubmit() method, this.createForm.controls['from'].value keeps giving me a null anyone know what i'm doing wrong?
72e038514ef1ba75500dfc0871ceb50b603a6d8d1440e0a43c8cb4b1239fbc23
['a80057868a2849d8881556ffb1eb28f6']
I have a pull-queue in Google App Engine and a resident backend which processes the tasks in the pull queue. The backend has several worker threads for consuming and processing tasks, as suggested in a post in Google Cloud Platform blog https://cloud.google.com/resources/articles/ios-push-notifications Workers poll the pull-queue with lease_tasks(). My question is: is lease_tasks() supposed to be a blocking method, i.e. block the current thread's execution until either the queue has some tasks or a deadline is exceeded? According to the GAE documentation https://developers.google.com/appengine/docs/python/taskqueue/overview-pull#Python_Leasing_tasks lease_tasks() accepts a 'deadline' parameter and may raise the DeadlineExceededError, thus isn't rational to assume that lease_tasks() blocks up to 'deadline' seconds? The problem is that while I 'm developing the application in the development server, lease_tasks() returns immediately with an empty list of tasks. The result is that the worker thread's while-loop is constantly calling lease_tasks(), thus consuming 100% of CPU. If I put an explicit sleep(), say for 5 sec, that will make the worker go to sleep and won't wake up if a task is placed in the queue in the mean time. That would make the worker less responsive (worst case, it might take ->5 secs for handling the next task), plus I would consume more CPU (wake up->sleep cycles) than just having the thread block in a 'queue' (I know the pull-queue is actually an RPC, yet it abstractly remains a producer queue) Perhaps this happens only with the dev app server while in GAE lease_tasks() blocks. However, the example code from the blog post mentioned above also suspends thread execution with sleep(). The example code is available in github and a link is in the blog post (unfortunately I cannot post it here)
4246eea77eb8277937a7b691231173a00f9e6afa459057435bae48811d438dbb
['a80057868a2849d8881556ffb1eb28f6']
Our GAE python application communicates with BigQuery using the Google Api Client for Python (currently we use version 1.3.1) with the GAE-specific authentication helpers. Very often we get a socket error while communicating with BigQuery. More specifically, we build a python Google API client as follows 1. bq_scope = 'https://www.googleapis.com/auth/bigquery' 2. credentials = AppAssertionCredentials(scope=bq_scope) 3. http = credentials.authorize(httplib2.Http()) 4. bq_service = build('bigquery', 'v2', http=http) We then interact with the BQ service and get the following error File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/gae_override/httplib.py", line 536, in getresponse 'An error occured while connecting to the server: %s' % e) error: An error occured while connecting to the server: Unable to fetch URL: [api url...] The error raised is of type google.appengine.api.remote_socket._remote_socket_error.error, not an exception that wraps the error. Initially we thought that it might be timeout-related, so we also tried setting a timeout altering line 3 in the above snippet to 3. http = credentials.authorize(httplib2.Http(timeout=60)) However, according to the log output of client library the API call takes less than 1 second to crash and explicitly setting the timeout did not change the system behavior. Note that the error occurs in various API calls, not just a single one, and usually this happens on very light operations, for example we often see the error while polling BQ for a job status and rarely on data fetching. When we re-run the operation, the system works. Any idea why this might happen and -perhaps- a best-practice to handle it?
b86e764c151676d4dc81bbe023152ebcac4e99b755df58ff9f74d082fe52322a
['a808b5dd24d347538552ceab40fae8e3']
I m having an entity like this: public class Entity { @Id private ObjectId id; private BasicDBList data; public ObjectId getId() { return id; } public BasicDBList getData() { return data; } public void setData(List<Map<String, Object>> data) { Objects.requireNonNull(data, "data"); this.data = new BasicDBList(); this.data.addAll(data); } } I m setting the data using an ObjectMapper, from json, to List, like this: List<Map<String, Object>> data = this.jsonMapper.readValue(JSON, List.class); Saving works fine. When I try to call BasicDAO public T get(final K id) { return ds.get(entityClazz, id); } I get an IndexOutOfBoundsException in IterableConverter.decode when it tries to call final MappedField mappedField = mf.getTypeParameters().get(0); Do I need to treat BasicDBList within Entities in a special way? Mongo Java Driver Version 3.0.2 Morphia Version 1.0.1 It used to work before with Mongo Java Driver Version 2.12.4 and Morphia 0.108
e8733da667921e9d6a351bd6ad8c6be7cc870e558f2bc02200c166c6c30c5a94
['a808b5dd24d347538552ceab40fae8e3']
After some research, here is my answer: db.collection.aggregate([ { $match : { date : { $gte : ISODate("2016-04-20T00:00:00.000Z")}}}, { $project : { _id: "$_id", views : { $cond : [ { $eq : [ "$date", ISODate("2016-04-20T00:00:00.000Z") ] }, { $add: [ { $ifNull : ['$hourly.22' , 0 ] } , { $ifNull : ['$hourly.23' , 0 ] } ] }, { $add: [ { $ifNull : ['$hourly.0' , 0 ] } , { $ifNull : ['$hourly.1' , 0 ] } ] }, ] } } }, { $group: { "_id" : "$_id", views: { $sum: { $add: [ "$views" ] } } }}, { $sort: { views: -1}} ]) The $cond attribute did the trick for me, so I could distinguish the different date datasets.
588908ee4d06d5d87a42b6effddb056e9cbc00cf94c7cfaa6f5eb61b7f6d193b
['a81033141b8340b48bf27633783a9279']
Even after migrating your Firebase project to the new console the 2.x SDKs will still continue to use the legacy email template when issuing password resets. If you use the 3.x SDKs and issue a password reset from there it will use the new email template. In either case you can manually trigger a password reset email that uses the new email template by going to the users tab in the authentication section (found at console.firebase.google.com/project/<your project name>/authentication/users) through the menu button on the right side of the user's row. Or you can change the wording of either the legacy or the new reset password email in the email templates tab in the auth section.
e9fea32f7635e129a194dbb8b4d7f939fd45bd887adfae482a6270d55f5ccdaf
['a81033141b8340b48bf27633783a9279']
I think I understand what you're describing and if so then I believe it is a bug: Create user A with email a Delete user A from the Firebase console Create user B with email a authData.uid for B is the same as A the uid for B in the Firebase console is some other random string What you can do as a work around for now would be to delete the user via the 2.x SDK instead of from the Firebase console.
b35847b2466410db1dedc856b2dc3a90b4eff6a48fd0610ce4f95b7027cdde0f
['a816a800d6fb43f2b9ac80a784fc339a']
I have a generic C++ CLI list which is populated with integers. I want to find the max value. Normally the list is sorted in ascending order. So I could just take the last item. Or I could sort the list and then take the last item but is there a way to avoid that and just do something like ->Max()? System<IP_ADDRESS>Collections<IP_ADDRESS>Generic<IP_ADDRESS>List<System<IP_ADDRESS>Int32>^ Testlist = gcnew System<IP_ADDRESS>Collections<IP_ADDRESS>Generic<IP_ADDRESS>List<System<IP_ADDRESS>Int32>(); Testlist->Add(1); Testlist->Add(2); Testlist->Add(3); Testlist->Add(4); int max = Testlist[Testlist->Count-1];//too iffy..without having to sort, can I get max?
3e5d061872a4b77542e46702ea85e509d5f865cf10861fd2e61e181293c6d9cf
['a816a800d6fb43f2b9ac80a784fc339a']
In another language I like to use object arrays containing every class object, and each object is very efficiently accessible via the object array. I am trying to do the same with Python and numpy. Each object has a number of members of different type, including a numpy array itself. So in the end result I need an object array of all objects which can efficiently be accessed and return any member, most importantly the member array. I tried something like this: class TestClass(): objectarray=np.empty([10, 1], dtype=np.object) ## static array holding all class objects def __init__(self,name,position): self.name=name self.position=position self.intmember= 5 self.floatmember=3.4 self.arraymember= np.zeros([5, 5]) ## another array which is a member of the class TestClass.objectarray[position]=self then: testobj1 = TestClass('test1',5) ## create a new object and add it at position 5 into the object array Something seems to have happened TestClass.objectarray array([[None], [None], [None], [None], [None], [<__main__.TestClass object at 0x000000EF214DC308>], [None], [None], [None], [None]], dtype=object) However this doesnt work: a= TestClass.objectarray[5] a.intmember --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-40-dac52811af13> in <module> 1 a= TestClass.objectarray[5] ----> 2 a.intmember AttributeError: 'numpy.ndarray' object has no attribute 'intmember' What I am doing wrong? Remember this needs to be an efficient mechanism inside a large loop (PS (I know I could use a list of objects, but iterating over lists is prohibitively slow in my testing. Hence I want to use numpy arrays, ideally augmented by numba)
75784ccb8be7e56282dc635f9daed0b03f19a1772ca3ae3cabaa35de7ec20603
['a82f44bd8b1c4afa88a26e5354c73128']
You seem to be confusing bits and bytes. A byte is composed of 8 bits, which can represent integer values from 0 to 255. So, Instead of sending {1,0,0,0,1,0,0,1}, splitting the byte array and parsing the bytes as bits to get 2 and 9, you could simply create your array as: byte[] data={2,9}; To send other primitive data types(int,long,float,double...), you can convert them to a byte array. int x=96; byte[] data=BitConverter.GetBytes(x); The byte array can then be written into stream as stream.Write(data,0,data.Length); On the client side, parse the byte arrays as: int x=BitConverter.ToInt32(data,startIndex); MSDN has great references on TCP clients and listeners. https://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient(v=vs.110).aspx
60aa83f956734b3e35d0b28c0d1894dad491222931e5a41a8a0f0d6e0febcadd
['a82f44bd8b1c4afa88a26e5354c73128']
read(client, buf, sizeof(buf)) returns -1 if the client has disconnected. So, loop for as long as bytes_read is greater than or equal to zero and recreate the server once the loop exits. I have rewritten your main function, wrapping the while loop in another loop that runs until 'x' is received from the bluetooth device. int recreate_connection=1; int main(int argc, char **argv) { while(recreate_connection==1) { vCreateConnection(); bytes_read=0; while(bytes_read >=0) { printf("\r\nClear buffer"); memset(buf, 0, sizeof(buf)); // read data from the client bytes_read = read(client, buf, sizeof(buf)); if( bytes_read > 0 ) { printf("received [%s]\n", buf); //if(status == 0) { printf("send [%s]\n", buf); status = write(s, &buf, 1); //status is not making any difference. //if(status < 0) //break; } } if(buf[0] == 'q') { vCloseConnection(); break; } else if(buf[0] == 'x') { recreate_connection=0; break; } } } // close connection close(client); close(s); return 0; }
815d8022712ff546bb5d5e0fa9cc80ca620afb76f31286c3cfc7c66287ca17aa
['a83863ca5f8d4b2ca84a666726a9417a']
I have a process that I have been able to drawn somehow with a flowchart. This process involves several classes, loops and several threads of execution. However I am unsure which (if any) UML diagram could be adequate to represent it. I thought first Sequence Diagrams since it includes loops and can represent-I think- threads of execution, but I am not sure what goes along the lifelines. It seems that I cannot represent anything of what is happening. Then I thought about Activity Diagrams but my textbook does not include loops in it. However looking at examples such as these ones it seems that loops can be represented simply in Activity Diagrams. I suppose that I can represent threads through Forks and Joins but I am open to listen to suggestion from more experienced designers.
af588fdf60940db3d6b8c5e065506931c681c078ffcb8d912f1e294f150fde3f
['a83863ca5f8d4b2ca84a666726a9417a']
As I commented to the other answer, perhaps my understanding of the word "prototype" is wrong. I thought "usable condition" meant prototype as opposed to say.. just documentation. So in simple words what should I have at the end of a sprint? A working software system? (even without the full functionality)
b3095d99627f0550ec16a753a82f38aa0d3b502bff1838377017e7b856e1e79a
['a83e8d25b8fe465fb60607a947cc746a']
I just started experiencing a bug where the SQLDeveloper 4.1.3 (latest) app icon freezes in the mac OS dock. This prevents me from relaunching the app without a hard reboot of the computer. sqldeveloper in dock Activity Monitor shows no app running. P1105S123LT3:~ dan$ ps -A | grep SQL 569 ?? 0:00.01 /bin/bash /Applications/SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh 4330 ?? 0:39.13 /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java -Xbootclasspath/a:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/dt.jar -Djdeveloper.system_http_proxy=DIRECT -Djdeveloper.system_http_non_proxy_hosts= -Dsun.java2d.noddraw=true -Dnetbeans.home=../../ide/bin/../../netbeans/platform/ -Dnetbeans.logger.console=true -Dexcluded.modules=org.eclipse.osgi -Dide.cluster.dirs=../../ide/bin/../../netbeans/fcpbridge/:../../ide/bin/../../netbeans/ide/:../../ide/bin/../../netbeans/../ -Xverify:none -Doracle.ide.extension.HooksProcessingMode=LAZY -Dorg.eclipse.equinox.simpleconfigurator.configUrl=file:bundles.info -Dosgi.bundles.defaultStartLevel=1 -Dosgi.configuration.cascaded=false -Dosgi.noShutdown=true -Dorg.osgi.framework.bootdelegation=* -Dosgi.parentClassloader=app -Dosgi.locking=none -Dosgi.contextClassLoaderParent=app -Xbootclasspath/p:../../ide/bin/../../rdbms/jlib/ojdi.jar -Dosgi.classloader.type=parallel -Dosgi.bundlefile.limit=500 -Dide.feedback-server=ide.us.oracle.com -Djavax.xml.transform.TransformerFactory=oracle.ide.xml.switchable.SwitchableTransformerFactory -Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory -Djavax.xml.stream.util.XMLEventAllocator=oracle.ideimpl.xml.stream.XMLEventAllocatorImpl -Doracle.ide.reportEDTViolations=bug -Doracle.ide.reportEDTViolations.exceptionsfile=../../ide/bin/../../ide/bin/swing-thread-violations.conf -Xms128M -Xmx800M -Doracle.ide.IdeFrameworkCommandLineOptions=-clean,-console,-debugmode,-migrate,-migrate:,-nomigrate,-nonag,-nondebugmode,-noreopen,-nosplash,-role:,-su -Dide.update.usage.servers=http://www.oracle.com/webfolder/technetwork/sqldeveloper/usage.xml -Doracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG=true -Dsun.java2d.ddoffscreen=false -Dwindows.shell.font.languages= -Doracle.ide.startup.features=sqldeveloper -Doracle.ide.osgi.boot.api.OJStartupHook=oracle.dbtools.raptor.startup.HomeSupport -Doracle.jdbc.mapDateToTimestamp=false -Doracle.jdbc.autoCommitSpecCompliant=false -Doracle.jdbc.useFetchSizeWithLongColumn=true -Dsun.locale.formatasdefault=true -Dorg.netbeans.CLIHandler.server=false -Dide.AssertTracingDisabled=true -Doracle.ide.util.AddinPolicyUtils.OVERRIDE_FLAG=true -Djava.util.logging.config.file=logging.conf -Dsqldev.debug=false -Dsqldev.onsd=true -Dcom.apple.mrj.application.apple.menu.about.name=SQL_Developer -Dcom.apple.mrj.application.growbox.intrudes=false -Dcom.apple.macos.smallTabs=true -Dapple.laf.useScreenMenuBar=true -Xdock:name=Oracle SQL Developer -Xdock:icon=SQLDeveloperIcons.icns -Xbootclasspath/p:../../rdbms/jlib/ojdi.jar -Dide.conf="/Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf" -Duser.conf="/Users/dan/.sqldeveloper/4.1.0/product.conf" -Dtool.user.conf="/Users/dan/.sqldeveloper/4.1.0/sqldeveloper.conf" -Dide.startingcwd="/Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin" -classpath ../../ide/bin/../../ide/lib/ide-boot.jar:../../ide/bin/../../netbeans/platform/lib/boot.jar:../../ide/bin/../../netbeans/platform/lib/org-openide-util-ui.jar:../../ide/bin/../../netbeans/platform/lib/org-openide-util.jar:../../ide/bin/../../netbeans/platform/lib/org-openide-util-lookup.jar:../../ide/bin/../../netbeans/platform/lib/org-openide-modules.jar:../../ide/bin/../../ide/lib/fcpboot.jar:../../ide/bin/../../ide/lib/xml-factory.jar:../../ide/bin/../../ide/lib/woodstox-core-asl-4.2.0.jar:../../ide/bin/../../ide/lib/stax2-api-3.1.1.jar:../lib/oracle.sqldeveloper.homesupport.jar oracle.ide.osgi.boot.OracleIdeLauncher 4536 ttys000 0:00.00 grep SQL P1105S123LT3:~ dan$ ps -A | grep SQL 4560 ttys000 0:00.00 grep SQL P1105S123LT3:~ dan$ kill -9 4330 -bash: kill: (4330) - No such process P1105S123LT3:~ dan$ kill -9 569 -bash: kill: (569) - No such process P1105S123LT3:~ dan$ When I run directly from shell, it launches P1105S123LT3:~ dan$ /Applications/SQLDeveloper.app/Contents/MacOS/sqldeveloper.sh When I kill it from another terminal window : P1105S123LT3:~ dan$ kill -9 12148 The shell from which I launched it returns this: /Applications/SQLDeveloper.app/Contents/Resources/sqldeveloper/sqldeveloper/bin/../../ide/bin/launcher.sh: line 1286: 12148 Killed: 9 ${JAVA} "${APP_VM_OPTS[@]}" ${APP_ENV_VARS} -classpath ${APP_CLASSPATH} ${APP_MAIN_CLASS} "${APP_APP_OPTS[@]}" P1105S123LT3:~ dan$ P1105S123LT3:~ dan$ P1105S123LT3:~ dan$ I have tried killall Dock which does not clear it. I have tired deleting /Users/dan/Library/Preferences/com.apple.dock.plist Still can't clear the app from the dock.... Any ideas??
e67b85845bcec1463de73e9eefd431f69464b84aaa590551796ee892da0d1ff2
['a83e8d25b8fe465fb60607a947cc746a']
So it appears that this was related to mac file structure corruption. I rebooted in safe mode and that rebuilt some caches which resolved the issue when I again rebooted in normal mode. I ran the disk utility repair to verify file structure as well. I talked with apple support who advised that safe mode bypasses the following caches, preferences, folders... so if need be - could wipe these folders to force a rebuilding of caches. /Users/myuser/library/cache /Users/myuser/library/LaunchAgents /Users/myuser/library/Saved Application State /library/Caches /library/LaunchAgents /library/LaunchDaemons /library/StartupItems
395e96f759d3209def99628a9f79cb4dbace3d11bbd5242c068f9c544cfbfc92
['a83faad2803d48cda77c52be39e1f845']
It's been a while since I've done TeX. I am working with TeXMaker on Mac: \begin \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \author{me} \title{my title} \begin{document} \part{Part One} Text \end{document} It claims there is an error on line 2: LOG FILE : This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex 2018.4.16) 4 JUL 2018 14:57 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **my-file-name.tex (./my-file-name.tex LaTeX2e <2018-04-01> patch level 2 Babel <3.18> and hyphenation patterns for 84 language(s) loaded. ! Missing \endcsname inserted. <to be read again> \let l.2 \documentclass [10pt,a4paper]{article} The control sequence marked <to be read again> should not appear between \csname and \endcsname. ! TeX capacity exceeded, sorry [input stack size=5000]. \documentclass ->\let \documentclass \@twoclasseserror \if@compatibility \el... l.2 \documentclass [10pt,a4paper]{article} If you really absolutely need more capacity, you can ask a wizard to enlarge me. Here is how much of TeX's memory you used: 5 strings out of 492650 179 string characters out of 6129648 60420 words of memory out of 5000000 3988 multiletter control sequences out of 15000+600000 3640 words of font info for 14 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 5000i,0n,4p,64b,16s stack positions out of 5000i,500n,10000p,200000b,80000s No pages of output. I got this code by using the "quick start" function in texmaker. I am utterly confused, why it's choking on this code. One theory I have is that I missing a package or something, but that doesn't make sense with the error and texmaker has not prompted me for a package. I don't see anywhere to manage packages. When I installed Tex (separately) I used TexLive to install packages and it appears I have the amsmath package at the very least. Any idea what's going wrong? I just want to test out TexMaker so I can write a paper.
86aa9866ddabe7faf53c9bdba435e1058df7a53f0fb3070cc93acf19e582e7a6
['a83faad2803d48cda77c52be39e1f845']
I am actually no physicist , but a computer scientist. Probably you will want to personally murder me for asking such a dumb question , but I have no knowledge of physics and I am asking out of curiosity. As far as I understand , photons die out when they interact with other matter. Thus , when a photon interacts with an electron of a lower energy level , the latter absorbs the photon and charges up and after a while discharges (emits the energy difference). And my question is : Can a magnetic (or other field) stop light in mid air ? For example , assume that a flashlight it pointed towards a wall , and there is a field in between the two latter objects. Is there a way that such a field may stop the light before it ever interacts with the wall ? In other words, imagine that you are witnessing the light being projected from the flashlight and then just disappearing mid distance and never reaching the wall. And again , please understand that I am a complete newbie in physics and I am asking just out of pure interest.
4ea6635e4d0356e792d6e486576c1def76905738d45ae4061018992a3405d3b9
['a842e09d7b9043bc86c4879bab4977f9']
Your answer focus on thermal efficiency, which is only part of the overall propulsive efficiency which determines fuel flow $\eta=\eta_{cycle}\eta_{prop}$ with $\eta_{prop}=\frac{2}{1+\frac{V_{jet}}{TAS}}$. From "Gas turbine theory" by <PERSON> and <PERSON>, overall propulsive efficiency is proportional to $\frac{TAS}{SFC}$. My assumption is that on iso-IAS lines, this value is constant
2ff14fb5bfc7964f1329c4b0d1c4d0ce9f1bd5acceb719459018f40ace8478d8
['a842e09d7b9043bc86c4879bab4977f9']
In magento2, desktop view comes from media point 768. i want to change this view. Rather than 768 my desktop view should start from 992. For that i am overritting the value of @screen__m from 768 to 992. But my changes are not reflecting. What are the other changes which i need to make ? Any solution ?
2bca074413191868f40c99af7af66b47779bc9e89042a03d5ffbf184bedb4997
['a84d68b2d5234f2e91cb9dd88d3bc73c']
The boxes are labelled, the balls are not, i.e. the children are distinguishable, the ballons are not. And in the R code it's exactly that case also: the kids are distinguishable (they are the marks in the table) and the balloons are not (each balloon justs counts as "1").
0b62ea9b9e5cf775c405a209233f761f1622789d6c5c415ff3b0c83c7dac1686
['a84d68b2d5234f2e91cb9dd88d3bc73c']
Ok, you mean like $\left(\frac{5}{6}\right)^{20}*6$? ... Which is the probability that exactly one child gets no balloons, right? Then add $\left(\frac{4}{6}\right)^{20}*{6\choose 2}$ and so on... All in all: $$\sum_{i=1}^5 \left(\frac{i}{6}\right)^{20}*{6\choose (6-i)}$$
e92b528db80d404ec1844ba01f5602c6f066c234ff22c006c7f3e83a568531e1
['a84f053c528046c598585e7b2d842b1e']
The program below compiles but doesn't print data to file. I also tried while(1) but didn't get the right output (no data). I am still trying to learn python embedded and file programming. Can anybody take a look and point me in the right direction? Code below: import logging import serial import serial.threaded import threading #import time #from datetime import * #import datetime import time as t from datetime import datetime import sys ser = serial.Serial('COM3',baudrate=9600, timeout=1) def getvalues(): arduionoData=ser.readline().decode('ascii') #('UTF-8')# return arduionoData def realtime(): """Generate time string""" dt0 = datetime.now() dt1 = dt0.replace(minute=1*(int)(dt0.minute),second= (int)(dt0.second),microsecond=0) return dt1.time().strftime('%H:%M:%S') extraction_file = open("C:/Users/gurbir/Desktop/Arduino /accelerometerXonly_jul09a/extraction.txt", "w") #while(1): extraction_file.write(getvalues()) #extraction_file.write(realtime()) t.sleep(3) #try to collect data for 3 seconds extraction_file.close() sys.exit()
146122606e8176e293e1d00a6108c7012c731b19948ac4ebd494131fe702335a
['a84f053c528046c598585e7b2d842b1e']
I did some research and got the problem resolved using subprocess. #!/usr/bin/python # # # import sys import os import subprocess import serial command1 = ['ssh','user@<IP_ADDRESS>'] command2 = ['cd','/workspace/mset-utils/tests'] command3 = ['sudo','./reboot_board.py'] command4 = ['python', '-m','serial.tools.list_ports', '-v'] cmd_and = ['&&'] #commands = command1 + command2 + command3 + cmd_and + command4 ''' getting same output as running at command line $ sudo ./reboot_board.py Traceback (most recent call last): File "./reboot_board.py", line 44, in <module> mode = argv[1] IndexError: list index out of range ----> have to reset the connection ''' commands = command1 + command2 + cmd_and + command4 ''' getting expected response $ python Test_code_Popen_serial_connection_3_14_20.py user@<IP_ADDRESS>'s password: 5 ports found /dev/ttyAMA0 desc: ttyAMA0 hwid: 3f201000.serial /dev/ttyUSB0 desc: Quad RS232-HS hwid: USB VID:PID=0403:6011 LOCATION=1-1.2:1.0 /dev/ttyUSB1 desc: Quad RS232-HS hwid: USB VID:PID=0403:6011 LOCATION=1-1.2:1.1 /dev/ttyUSB2 desc: Quad RS232-HS hwid: USB VID:PID=0403:6011 LOCATION=1-1.2:1.2 /dev/ttyUSB3 desc: Quad RS232-HS hwid: USB VID:PID=0403:6011 LOCATION=1-1.2:1.3 ''' process = subprocess.Popen(commands, stdout=subprocess.PIPE, universal_newlines=True) while True: output = process.stdout.readline() print(output.strip()) # Do something else return_code = process.poll() if return_code is not None: print('RETURN CODE', return_code) # Process has finished, read rest of the output for output in process.stdout.readlines(): print(output.strip()) break
eb2eae19e95fee086c45aededdb41a021c570a84955eddeeeba5869a72c3d03d
['a85864e6412d460482fa4aa33d2e5d6e']
I'm now trying to implement a server using c++, I try to save the information of the users into database, but I came across some problem while connecting to the database. I can't build my program because of the following errors generated by code blocks -------------- Build: Debug in server (compiler: GNU GCC Compiler)--------------- mingw32-g++.exe -Wall -fexceptions -g -lpthread -lmysql -I"D:\Program Files\MariaDB 10.1\include\mysql" -c D:\Projects\server\main.cpp -o obj\Debug\main.o mingw32-g++.exe -L"D:\Program Files\MariaDB 10.1\lib" -o bin\Debug\server.exe obj\Debug\main.o "D:\Program Files (x86)\CodeBlocks\MinGW\lib\libwinpthread.a" "D:\Program Files (x86)\CodeBlocks\MinGW\lib\libws2_32.a" obj\Debug\main.o: In function `main': D:/Projects/server/main.cpp:13: undefined reference to `mysql_init@4' D:/Projects/server/main.cpp:14: undefined reference to `mysql_real_connect@32' collect2.exe: error: ld returned 1 exit status Process terminated with status 1 (0 minute(s), 2 second(s)) 3 error(s), 3 warning(s) (0 minute(s), 2 second(s)) I downloaded MariaDB Connector/ODBC 2.0.10 Stable from its official website and I've tried many different solutions that I found on the Internet, but it still doesn't work. Can anybody help me solve this? Any reply will be appreciated.
5d8d243b841218361530890df1773067899d3f5805d5a17c49b13f99572e6fa1
['a85864e6412d460482fa4aa33d2e5d6e']
It turns out that both my input and output buffer are wrong, they both need to be two dimensional array as <PERSON> mentioned. Here is the working code func Scale(img []byte, outw, outh int) []byte { input, _, _ := image.Decode(bytes.NewReader(img)) if a, ok := input.(*image.YCbCr); ok { width, height := a.Rect.Dx(), a.Rect.Dy() var format C.enum_AVPixelFormat = C.AV_PIX_FMT_YUV420P context := C.sws_getContext(C.int(width), C.int(height), format, C.int(outw), C.int(outh), 0, C.int(0x10), nil, nil, nil) y := (*C.uint8_t)(C.malloc(C.ulong(len(a.Y)))) C.memcpy(unsafe.Pointer(y), unsafe.Pointer(&a.Y[0]), (C.size_t)(len(a.Y))) cb := (*C.uint8_t)(C.malloc(C.ulong(len(a.Cb)))) C.memcpy(unsafe.Pointer(cb), unsafe.Pointer(&a.Cb[0]), (C.size_t)(len(a.Cb))) cr := (*C.uint8_t)(C.malloc(C.ulong(len(a.Cr)))) C.memcpy(unsafe.Pointer(cr), unsafe.Pointer(&a.Cr[0]), (C.size_t)(len(a.Cr))) in := []*C.uint8_t{y, cb, cr} stride := []C.int{C.int(a.YStride), C.int(a.CStride), C.int(a.CStride), 0} outstride := []C.int{C.int(outw), C.int(outw / 2), C.int(outw / 2), 0} paneSize := outw * outh a := (*C.uint8_t)(C.malloc(C.ulong(paneSize))) b := (*C.uint8_t)(C.malloc(C.ulong(paneSize >> 2))) c := (*C.uint8_t)(C.malloc(C.ulong(paneSize >> 2))) out := []*C.uint8_t{a, b, c} C.sws_scale(context, (**C.uint8_t)(unsafe.Pointer(&in[0])), (*C.int)(&stride[0]), 0, C.int(height), (**C.uint8_t)(unsafe.Pointer(&out[0])), (*C.int)(&outstride[0])) min := image.Point{0, 0} max := image.Point{outw, outh} output := image.NewYCbCr(image.Rectangle{Min: min, Max: max}, image.YCbCrSubsampleRatio420) C.memcpy(unsafe.Pointer(&output.Y[0]), unsafe.Pointer(a), (C.size_t)(paneSize)) C.memcpy(unsafe.Pointer(&output.Cb[0]), unsafe.Pointer(b), (C.size_t)(paneSize>>2)) C.memcpy(unsafe.Pointer(&output.Cr[0]), unsafe.Pointer(c), (C.size_t)(paneSize>>2)) opt := jpeg.Options{ Quality: 75, } var buf bytes.Buffer w := bufio.NewWriter(&buf) jpeg.Encode(w, output, &opt) return buf.Bytes() } return nil }
dc578f392f6a97c864436e3657027f6bac4e1605d101f4f33e2bbf3976b04edc
['a85cec2db5e84d7fb3fcb274016034c5']
The problem is in that that I'm just flood filled number tiles as a spaced tiles and this just uncovered all area except mines instead of just some area. Now if function found a number it's stops and draws number. else if (closedMap[x][y] > EMPTY && closedMap[x][y] < CLOSED) // If this cell is contains number... { openedMap[x][y] = closedMap[x][y]; return; }
8c7cb389a82baa37d0cd04f200269854abf2225ba2e1302c3ec559b263e5a502
['a85cec2db5e84d7fb3fcb274016034c5']
So I solved problem by adding a head section in body container and using constructor without parameters, also i deleted checking of vector size where it's not needed (no). Here is my new code: Snake<IP_ADDRESS>Snake() { body.reserve(4); head.setPosition(400, 400); head.setSize(Vector2f(20.f, 20.f)); head.setFillColor(Color(0, 0, 0)); body.push_back(head); for (int i = 0; i < 3; i++) { bodyPart.setPosition(body.at(i).getPosition().x - 20, body.at(i).getPosition().y - 20); bodyPart.setSize(Vector2f(20.f, 20.f)); bodyPart.setFillColor(Color(0, 0, 0)); body.push_back(bodyPart); } } void Game<IP_ADDRESS>restart() { for (unsigned int i = 0; i < snake.body.size(); i--) { snake.body.pop_back(); } snake.head.setPosition(400, 400); } void Game<IP_ADDRESS>tick() { moveSnake(); if (snake.body.at(0).getPosition().x == fruit.fruitX && snake.body.at(0).getPosition().y == fruit.fruitY) { snake.body.reserve(1); for (unsigned int i = snake.body.size() - 1;i > 0;i--) { snake.body.at(i).setPosition(snake.body.at(i - 1).getPosition().x - 20, snake.body.at(i - 1).getPosition().y - 20); } } countCollision(); } void Game<IP_ADDRESS>moveSnake() { switch(dir) { case 1: snake.body.push_back(snake.bodyPart); snake.body.at(0).move(0, snake.body.at(0).getPosition().y + 10); snake.body.pop_back(); case 2: snake.body.push_back(snake.bodyPart); snake.body.at(0).move(0, snake.body.at(0).getPosition().y - 10); snake.body.pop_back(); case 3: snake.body.push_back(snake.bodyPart); snake.body.at(0).move(snake.body.at(0).getPosition().x + 10, 0); snake.body.pop_back(); case 4: snake.body.push_back(snake.bodyPart); snake.body.at(0).move(snake.body.at(0).getPosition().x - 10, 0); snake.body.pop_back(); } } void Game<IP_ADDRESS>countCollision() { if (snake.body.size() >= 5) { //If snake eats itself for (unsigned int k = 1; k < snake.body.size(); k++) { if (snake.body.at(0).getPosition().x == snake.body.at(k).getPosition().y && snake.body.at(0).getPosition().y == snake.body.at(k).getPosition().y) { restart(); } } } } void Game<IP_ADDRESS>render(RenderWindow& window) { for (int i = 0; i < snake.body.size(); i++) { window.draw(snake.body.at(i)); } }
8a2eaee8ec7d47ee35716d00636cb37b82ff3e8cd5b4d69811ce795e73d67ec4
['a8663eb63b1541a18dfad1cf4f279c33']
I've opened up a knockoff game cube controller and I want to know what the power via is labelled as. There is a 5v which is fine but what are the 'v' and 's' pins? Photo attached. The cable is a standard game cube plug but I'm wondering if its just USB and if I can therefore splice it into a USB plug. Cheers
888f9731561110657b3e869a3ee884aeb11fd98117c81b78a5d62c8a7427c879
['a8663eb63b1541a18dfad1cf4f279c33']
If one imagines turning a knot, and looking at its projection on the plane, it will change between different projections of the same knot. In between, there will be some singularities when more then 2 points get projected to the same point on the plane. Not all such transformations of the projection correspond to <PERSON> moves, for example turning the unknot, represented by a circle in 3-space, gives a singularity where all points all projected onto a line, before it is the unknot again. However, this could be prevented by modifying the knot a bit by an isotopy, so that this turning would correspond to some <PERSON> moves. My question is: Can every knot be slighly modified in some way so that only <PERSON> moves happen? Or formulated in another way: Are there some exotic moves that can happen to the projection of a knot if I rotate it? I hope I expressed myself clearly, even if I am not sure if this question makes sense.
5f382ce351819f97252447de750813b94040683089ead6405af5ba35c56a0257
['a8757b7d4fa04b3c8435221fc9291192']
Thank you all~~~ I think I figure out how to do that. I use css3's property: column.(css3 column property)I think it it quite same as the bootstrap grid layout. It's my first time to post question here, and I got so many answers in such a short time. You guys are awesome! Thanks again!
2165e4f8c1aab786b8146c07b18761c8e4905b8d59f3ee22b084d5de3f101005
['a8757b7d4fa04b3c8435221fc9291192']
what I want to do is to drag a element in the left sidebar to the center area, as shown in the image. But not working, although no error message show up. image of the page My code is: //drag and drop - not working WebElement element = driver.findElement(By.xpath("//*[@id='componentsSection']/div[1]/div[1]")); Thread.sleep(1000); WebElement target = driver.findElement(By.id("layoutSection")); Thread.sleep(1000); (new Actions(driver)).dragAndDrop(element, target).build().perform(); Thanks in advance!
1a7d54c19f93a63e37f6afda12b84d3ab62f619f1df1e6df4c4edcee0e988deb
['a87b2af5bfeb4884a0213f60bea4b67c']
You don't need bs4 for this purpose because you only require info from cookies. (use bs4 only if finally you need to extract something from html code). For the cookies stuff I would use python-request and its support to http sessions: http://docs.python-requests.org/en/latest/user/advanced/
ef34d5221eb1308a7b36c51d4131d1345c7d9b7820458673e8a85eb4f501d440
['a87b2af5bfeb4884a0213f60bea4b67c']
Wireshark is a overkill... just take a look to the network tab in Google Chrome. There you can see that you POST data needs a format like this: post_data = {'UserName': 'Monash\%s' User, 'Password': Password, 'AuthMethod':'FormsAuthentication'} Also would be a great idea if you use a proper User Agent. If you don't do it probably you will be detected as a bot and web server will deny you access. Another tip: Set proper headers in every POST requests (content-type, accept....)
d7e0834c0a784db8bd34daee0adee20a251852c288040cc0eb24ecdd80763893
['a87c4f9094a446a588406cd2c06fc51a']
I have this script and he return this error in console SyntaxError: missing ) after argument list but i dont found where is the error in my code. <video autopĺay id="cam" width="400" height="400" muted></video> <script> const cam = document.getElementById('cam') const startVideo = () => { var constraints = { audio: true, video: { width: 1280, height: 720 } }; navigator.mediaDevices.getUserMedia(constraints) .then(function(mediaStream) { var video = document.querySelector('video'); video.srcObject = mediaStream; video.onloadedmetadata = function(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); // always check for errors at the end. } Promise.all([ faceapi.nets.tinyFaceDetector.loadFromUri("<%= asset_path('face-api.js/models/tiny_face_detector_model-weights_manifest.json') %>", faceapi.nets.faceLandmark68Net.loadFromUri("<%= asset_path('face-api.js/models/face_landmark_68_model-weights_manifest.json') %>", //desenha <PERSON> do rosto faceapi.nets.faceRecognitionNet.loadFromUri("<%= asset_path('face-api.js/models/face_recognition_model-weights_manifest.json') %>",//faz o conhecimento do rosto faceapi.nets.faceExpressionNet.loadFromUri("<%= asset_path('face-api.js/models/face_expression_model-weights_manifest.json') %>",//detecta expressoes faceapi.nets.ageGenderNet.loadFromUri("<%= asset_path('face-api.js/models/age_gender_model-weights_manifest.json') %>", //idade e genero faceapi.nets.ssdMobilenetv1.loadFromUri("<%= asset_path('face-api.js/models/ssd_mobilenetv1_model-weights_manifest.json') %>" // usada para detectar rosto ]).then(startVideo) cam.addEventListener('play', async() => { const canvas = faceapi.createCanvasFromMedia(cam) }) </script>
43055e7855bdbabf6568fa1897c245b78a2fa00a1dfa0a2e02fdef968e1121f7
['a87c4f9094a446a588406cd2c06fc51a']
It is the first time that I will deal with a javascript library in rails. In this case, I'm going to use TrackingJS to work with facial recognition, but as I never used it, I don't know how to include it in my project and use it. I use rails 5.
180434bafc7ca3a3b32e3e36943c9da474b081613498aefa958833c5182fdfd2
['a88958dd931549958ed81990cf014077']
I improved <PERSON> answer using Dart 2.7 Extension Methods to make it more elegant. enum Fruit { apple, banana } extension EnumParser on String { Fruit toFruit() { return Fruit.values.firstWhere( (e) => e.toString().toLowerCase() == 'fruit.$this'.toLowerCase(), orElse: () => null); //return null if not found } } main() { Fruit apple = 'apple'.toFruit(); assert(apple == Fruit.apple); //true }
33649646cdaa6cec46b6ce012fccd1ffb207866b08d1ea8c7e94957420f41777
['a88958dd931549958ed81990cf014077']
I solved my issue using nested Navigator. Here is the example: import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: Home(), )); } var homeNavigatorKey = GlobalKey<NavigatorState>(); class Home extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Navigator( key: homeNavigatorKey, onGenerateRoute: (settings) { /*dirty code for illustration purposes only*/ if (settings.name == '/child') { return MaterialPageRoute(builder: (context) => Child()); } else { return MaterialPageRoute( builder: (context) => Column( children: <Widget>[ Center( child: Text("This is home"), ), RaisedButton( child: Text("Open child view"), onPressed: () { homeNavigatorKey.currentState.pushNamed('/child'); }, ) ], )); } }, ), ); } } class Child extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Container( child: RaisedButton( onPressed: () => Navigator.of(context).pop(), child: Text("Back to home"), ), )); } } The tree looks like this and allows for passing data from Home to every child. Feel free to comment or post answers if you have any simpler solution.
924db3eef571ffe28df5c4eb6bf3dcd4265480000b29daf750b04043aed67354
['a89c1200518344d1bfab87b65c709a79']
Comments and white space are completely ignored when the code is run. You can think of all that extra stuff as being completely wiped away once your done and the code is doing its thing. Extra white space and comments are solely there for you and fellow coders to be better able to read and understand your code. In fact, if you don't use extra white space and comments, coders will get angry with you for writing and providing terrible code!
edb3db907c3d5bc70fbde5c7fb78247ab3e415fae44655383dca2535b0c23949
['a89c1200518344d1bfab87b65c709a79']
This is a scope issue. You need to instantiate (create) $newVar outside of the function first. Then it will be view-able by your other function. You see, scope determines what objects can be seen other objects. If you create a variable within a function, it will only be usable from within that function. Once the function ends, that variable is eliminated! So to fix, literally just create "$newVar" before you create the function and you should be good to go.
6d4f8907bc4c45ee719e5c9719ce0981a3298dab4affeedfd59a9fdce26456b1
['a8a987d011384e838759a70d75f59352']
I am facing difficulties while trying to insert a date variable into a database table. My variable is called: Date date4; The date4 variable value is read from a textbox which has a calendar picker. For inserting in a date column, I am setting the field type to date: preparedstmt.setDate(4,date4); However, I got the below message after submitting the form: javax.faces.component.UpdateModelException: java.lang.IllegalArgumentException: Cannot convert 4/1/15 12:00 AM of type class java.util.Date to class java.sql.Date Also, is there a way to insert the field in the format of date ("dd-MON-YYYY")?
7deef05352a4ac1143cedc6f4d979c5d2c2efba6b46a98d126fdead0bf5b7ff1
['a8a987d011384e838759a70d75f59352']
I am facing difficulties in mapping the values of two arrays to each other. I am having a string array list which is storing the users selected values: private List<String> selectedCertificates = new ArrayList<String>(); The above array will store as an example ["SS", "CC", "SC"] and at the same time the user can select a language for certain types but not all of them. For example the type "SS" and the type "CC" should be by default "English" where "SC" can be either English or French or any other language. String[] DocType = new String[4]; String[] DocLanguage = new String[4]; DocType[0] = "CE"; DocLanguage[0] = "EN"; DocType[1] = "SC"; DoctLanguage[1] = "EN"; DocType[2] = "SS"; DocLanguage[2] = ssLanguage; DocType[3] = "RR"; DocLanguage[3] = "FR"; So now my issue is that I want to have a string array for the selected languages only that it will include ["EN","EN",valueofssLanguage] for the same sequence of the selected certificates ["SS", "CC", "SC"], so how can I achieve this? Thanks
d1a78a100473acf804c9987fa32ab2b8b9167aae0d5e45ab7237cb5bd6e8fe87
['a8d7aa91e6d34b48b9e69939132bab9b']
<PERSON> can you explain it again? I don't really now what you mean "with hat maps x∈N to the xth digit in the sequence of every base N−1 number (in ascending order)" I though you just meant the last digit of the number in hexadcimal (if N is 9 for example)
259c5d1148c9865247e0f97f93229810b0fbb8c4666e328f5fa783551ae98df3
['a8d7aa91e6d34b48b9e69939132bab9b']
partially, I understand why ECM and EMC and MBC and MCB are eqaul (ss traingle), but I don't understand why MCB+MBC are equal to EMC, and I also dont understand why mcb is equal to cad, since there doesn't seam to be any paralel lines in the figure
b940edd7b726f1c326c47a6ceb3895d8bd23c66d6a8d236c99b63a9c1ed26a4f
['a8dbeedd25f54717958b4a91c202c5ff']
I would like to invite someone external to my organization to be part of a Skype for Business meeting which I am setting up in Outlook. I sent him a connection request using the Skype ID he gave me, but it doesn't seem to be working, so he asked me for my Skype ID so we can connect that way. Where can I find out what my ID is in Skype for Business?
e9ddd1aec57be1e981d5efe094bee7d8877ea8c475745c783cb1750ebaacadc9
['a8dbeedd25f54717958b4a91c202c5ff']
I was not the one who downvoted you, but it seems that a printer can actually have different DPIs in the horizontal and vertical directions based on [link](https://superuser.com/questions/160219/what-advantage-does-a-2400x600-dpi-printer-have-over-a-1200x1200-dpi-printer). But I don't know how this works with software that assumes one DPI value for the whole image, like Matlab does.
37ef67637995a96482adfb2e881adb14bb05b3cc2e8ba8359d39eab8a170d96b
['a8e0546168f4446ebf0c89b887551f88']
the error means that you did not import the package while calling the constructor on line 1. And the second is working because you called the function by specifying the package ! Do an import com.example.alarm then do DialogFragment timepicker = new TimePicker(); it will work or either import the appropriate package containing TimePicker class before instanciating it.
215e199dd744e6c5b32a945ab30c8cd982e8594809aec49e761d261bb521b678
['a8e0546168f4446ebf0c89b887551f88']
to solve my problem . first i autoload the kernel by adding in my composer.json file "autoload": { "files": [ "app/AppKernel.php" ] }, then i modify the file app/console.php by adding on the top : require_once DIR.'/autoload.php'; and i comment the line //require_once __DIR__.'/AppKernel.php'; for more information go to https://github.com/symfony/symfony-standard/issues/868 after i delete the bundle whiteoctober/tcpdf-bundle manually . the i look for a version compatible with symfony 3.3.2 which is the symfony 's version i am using . I add this require in my composer.json file "require": { "whiteoctober/tcpdf-bundle": "~the_Compatible_version_for_you" }, for me i did "require": { "whiteoctober/tcpdf-bundle": "dev-master" },
f721be9c746b905aba0b6ae8a4933eddad6b9ae882698b37649cd049a8f1a9d8
['a8e50697dae8450f9e0a63c7d562436e']
i have a few problems with multi language support. My website is using charset iso 8859 1 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> When i the fetched title or content is in chinese, the display will be funky text $doc = new DOMDocument; if (@$doc->load($url) === false) return; $title = $doc->getElementsByTagName("title")->item(0)->nodeValue; $content = $doc->getElementsByTagName("content")->item(0)->nodeValue; However if i change my header to UTF-8, it will work, however due to other scripts i wont be able to do that. any idea how? <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
2b6c80fad86b28379f256e88e12aab968fe187f54a3744b6ab745bfceac8eafe
['a8e50697dae8450f9e0a63c7d562436e']
I also tested the disk on other hardware, where I was asked for the password, but can't unlock. My suggestion is, that the samsung bios, is changing the password in some way. I tested to use scanline codes but had no success. Filling the password up to 32 chars is an idea, I hope to have some time to test it soon. http://thaeial.blogspot.de/2013/01/locking-and-unlocking-hdd-with-dell.html
4ddc6fb2ce503b7ac0f65911107f9b12b11fd2910ceb0e9fc77f0f6fc0c1d73d
['a8eb6b602163487c8f3a1e2464ee34b3']
This is a feature of rails that prevents cross site scripting attacks. It really depends what you are doing but what you need to do is pass this secret that rails passes in every params hash. Check you log file or server or debug your params and you will see this. It is a really long code. This code is generate in your environment.rb file so whenever you pass params to your application you need to include this file.
8889d1676408e1b6bba03b84168e0c7f4da2d4d9acea26135c8eaceaea991fed
['a8eb6b602163487c8f3a1e2464ee34b3']
Rails uses the MVC paradigm. It's interesting in models, views, and controllers, really only controllers have an 'application' or parent controller. Actually there is an application_helper in rails but it really doesn't do much. What's the point of only have an application_controller where as models and in practice helpers do not have a parent?
70ee20538fb7866bc4e2d63e934ac8d3923b3fa3cc06500d80962506bafc1cd0
['a8f837c30c7d45b8982a00677956f0cc']
Is there a Design Pattern for Data Object structures that frequently change? I am refactoring a Genetic Algorithm where the structure of the Chromosomes (number of genes, type of genes and boundary of genes) change from problem to problem. For example: One problem may use class Chromosome{ double gene1; // 0.0 < gene1 < 100.0 double gene2; // -7.3 < gene2 < 9.0 } Another problem may use class Chromosome{ int gene1; // 200 < gene1 < 1000 double gene2; // 50.0 < gene2 double gene3; // gene3 < -5.0 } Currently the chromosome structure is hard coded and is difficult to modify for a new problem. I am considering modifying the Strategy Pattern for chromosome changes, unless someone has a better idea.
cbce6e2ab0a827e95576b99d1b4ce69b62bdb6e4e46d45d5dfeb4b2b82950845
['a8f837c30c7d45b8982a00677956f0cc']
Thanks to <PERSON>’s help, I believe I have a solution. I left off ID and Boundary for simplicity. IGene and Gene classes are the solution. TestGene is a test implementation. public interface IGene<T>{ //Accessors public T getValue(); public void setValue(T value); } public class Gene<T> implements IGene<T> { //Attributes T _value; //Accessors public T getValue(){ return this._value;} public void setValue(T value){ this._value = value; } } import java.util.ArrayList; import java.util.List; public class TestGene { public enum EnumType {VALUE1, VALUE2} public TestGene() { IGene gene; List<IGene> chromosome = new ArrayList(); gene= new Gene<Double>(); gene.setValue(1.08); chromosome.add(gene); gene = new Gene<Integer>(); gene.setValue(3); chromosome.add(gene); gene = new Gene<EnumType>(); gene.setValue(EnumType.VALUE1 ); chromosome.add(gene); for (int i = 0; i < chromosome.size(); i++ ){ System.out.println( chromosome.get(i).getValue() ); } }
190d7cc3c8cc20f7a77b2f1d090127d1c3307f195bbbe39b8ada83e820c24810
['a8fb799b93274782ad09a264276997b9']
I have a text file called output.txt that will generated inside D:/MPI. I have to download this file but the file which is getting downloaded is completely blank and does not have any contents. I want to download the file output.txt which is in the folder D:/MPI. Here is my code of JSP <% String filePath = "D://MPI//output.txt"; String fileName = "outputs"; FileInputStream fileToDownload = new FileInputStream(filePath); ServletOutputStream output = response.getOutputStream(); response.setContentType("text/plain; charset=utf-8"); response.setHeader("Content-Disposition","attachment; filename="+fileName); response.setContentLength(fileToDownload.available()); int c; while((c=fileToDownload.read()) != -1){ out.write(c); } output.flush(); output.close(); fileToDownload.close(); %> Kindly guide me
d32a81a877ed9b268f5918c99c07aa2e9773dcacab0daf1f97bb21360ef14d44
['a8fb799b93274782ad09a264276997b9']
I have a function which takes a tab delimited file as an input and creates scatter plot for the values(one scatter plot per file) in the tab delimited file.I need a function which can print scatter plots in one pdf file(ie one scatter plot per page).Here is my function which prints one scatterplot per file. scatter.plot=function(file) { raw.Data=read.delim(file="D:/output/illumina.txt",row.names = 1, dec = ".") raw.expression <- raw.Data[,seq(1,dim(raw.Data)[2],2)] dim(raw.expression) raw.calls <- raw.Data[,seq(2,dim(raw.Data)[2],2)] dim(raw.calls) IDs <- colnames(raw.expression) for (i in 1:(dim(raw.expression)[2]-1)) { for( j in i:(dim(raw.expression)[2]) ) { if (i != j) { pdf(file=paste(directory,"/",IDs[i],"_gegen_",IDs[j],".pdf",sep="")) correlation <- round(cor(raw.expression[,i],raw.expression[,j]),2) maximum <- max(log2(raw.expression[,i])) minimum <- min(log2(raw.expression[,i])) plot(log2(raw.expression[,i]),log2(raw.expression[,j]),xlab=IDs[i],ylab=IDs[j],pch='.',text(maximum-2,minimum+0.5,labels=paste("R = ",correlation,sep=""),pos=4,offset=0)) dev.off() } } } } The above function takes the illumina text file as a input and prints each scatter plots in single pdf.I want all them in one pdf.. As the illumina text file is large..I ve given a minimal information code for input data is below input.file=list(ProbeID=c(870131,5310368,1070445,6770328,610373,450431,1050114,770300,3290546),X1692272066AAVGSignal=c(46.1234,48.73746,50.15939,51.36239,53.75028,55.18534,49.32711,49.49868,50.40989),X1692272066ADetectionPval=c<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,0.1390102,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>),X1692272066BAVGSignal=c(49.38838,50.76025,50.41117,50.52384,58.56867,55.49637,48.71999,57.0689,45.99026),X1692272066BDetectionPval=c<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,0.<PHONE_NUMBER>,0.1441048,<PHONE_NUMBER>,0.<PHONE_NUMBER>,<PHONE_NUMBER>),X1692272066CAVGSignal=c(52.47962,51.48042,51.93637,50.08885,56.68196,54.18305,52.03677,57.8032,52.71201),X1692272066CDetectionPval=c<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,<PHONE_NUMBER>,0.1783115,<PHONE_NUMBER>,<PHONE_NUMBER>,0.1106259,<PHONE_NUMBER>))' Please do help me
af812628050a471240fd9f60adf0036acbc7d7047d176382f052e83f2342ef43
['a905f04b35444e30acde0390542f5b5b']
Yes you can expose your own wsdl like this (using the example data from the wscf.blue walkthrough), with externalMetadataLocation being the important part: <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyBehavior"> <serviceMetadata httpGetEnabled="true" externalMetadataLocation="../ContractMetaData/RestaurantService.wsdl"/> </behavior> </serviceBehaviors> </behaviors> ... <services> <service name="RestaurantService.RestaurantService" behaviorConfiguration="MyBehavior"> ... </service> </services> </system.serviceModel> But I haven't had any luck making this work in conjunction with "add service reference". VS keeps generating code that isn't compatible with the webservice generated by wscf.blue.
845f3694aa10901a5a54c705487a9e06e90f11bb4840e0f850128ba3c0e774b2
['a905f04b35444e30acde0390542f5b5b']
I actually did the same thing, but this seems more like a hack than a solution. Might be the best we'll get though. I'd figure that in my case it's not heat related either, because sometimes it works just fine under heavy load and if it decides to start lagging it starts right with the high load. I'd suppose that if it was heat related it'd take a bit to heat things up. I'm no specialist though. Obviously.
e38d9a26ed1e2060cb1b304a9f3ae6e97c892d7e1f9023f1dd4ddd4208130815
['a917ff96443247d48e8ae084c0dfb9a1']
I'm stuck a little with my Witcher I walkthrough. I play Witcher I (EE, 1.45.1280) with FCR mod installed and use the 4th difficulty (of total 6). So I'm on the final fight and I really cannot do anything with it. Grand Master is pretty strong and also he has something near a dozen of ifrits around him for help. The first strategy is that I try to beat the Master himself. But with FCR he does not die fast. After a few seconds his ifrits start to attack me from all sides. Of course, <PERSON> dies. The second strategy is to beat all the servants first. And it works fine except one detail - when I kill all servants game constantly crashes. When I kill all except one, but then start to attack the Master - the game crashes. All the time. So literally I have to options: <PERSON> dies or game crashes. Does anyone has suggestions for this battle? Or, maybe, a console command or something like that to skip it. I'm really desperate with it.
d78756ec272e9a3f38301f50e5ffac8c1e3fb7c263cddc7e4b6b64e28a2f1a8b
['a917ff96443247d48e8ae084c0dfb9a1']
Fair point. I meant underlying theory from which all of collision detection stems. In other words, if I'm writing a collision detection subsystem, do I need to write one function for each type of primitive/primitive collision, or is there a single generic function that works no matter what the primitive is?
e7fb4b226cb20dbcf45c91e9212c98f661b50ab0eafbbfc4a1a03ba94c837889
['a93522c65cff4f6cb4bbde96d5c35ea2']
Windows users: After you installed OpenJPEG and added its bin folder to PATH, you need to re-build the pillow library. Using Conda I didn't find a solution to do that so I ended up using the windows installer from PyPi as suggested in this answer here. The installer found my Anaconda installation and it seems it simply overwrote the pillow library there.
8f52e28594e3ed5e2656a9c4e653f5e78a5d652ace657fafd2f6c8f15ea74e7b
['a93522c65cff4f6cb4bbde96d5c35ea2']
Ideally you use a build-server like travis-CI or gitlab-CI that builds, tests and deploys your source. I asked a similar question recently and ended up building the following pipeline: build-stage: npm install to install node_modules * compile typescript to dist folder test-stage: linting (although some recommend this before building) other code inspection unit testing deploy: (only on master branch) npm prune --production to remove dev-dependencies from node_modules use scp to copy dist and node_modules to prod server use ssh to remove files from earlier deployments and to tell pm2 to reload server.js * note that if you use modules that use native code and thus are compiled on npm_install (node-gyp), you have to make sure your build-server uses the same architecture as your production environment
12bb4247ecf6e8710c0cb19083d171e69d689215a18ed3368245eab1ed10f8e8
['a93decb90d50418295239e68da006381']
By <PERSON>'s little theorem, we have $x^3\equiv x\pmod3$ for every $x$, and of course, $x^3\equiv x\pmod2$. This means that $$ a^3+b^3+c^3\equiv a+b+c\pmod3$$ and $$ a^3+b^3+c^3\equiv a+b+c\pmod2,$$ which was what we wanted.
19b8829afc354404436ef66f72ed089c0b55a4c43fc92e4383c8fe73177b60ed
['a93decb90d50418295239e68da006381']
Yes. If there exists no $c$ such that $\|Ax\|\geq c\|x\|$ for all $x$, then there exists a sequence $x_1,x_2,\dotsc$ such that $\|x_i\|=1$ for all $i$, and $\|Ax_n\|\to 0$ as $n\to \infty$. Since $\mathbb{R}^n$ is finite-dimensional, its unit ball is compact, hence some subsequence $(x_{k_i})_i$ tends to a limit $x$ in the unit ball (by compactness). But $A$ is bounded and linear, hence continuous, so we get $$\|Ax\|=\lim_i \|Ax_{k_i}\| =0$$ i.e. $Ax=0$ for an $x$ with $\|x\|=1$, which contradicts the fact that the columns of $A$ are independent.
f51af3880c9356d8f7ae6a8c71aeeeead0dd6f28ae8742150152d90d0ba405a8
['a9428878e95d4b84be7130d05c70bc32']
Stupid mistake and I can't believe it took so long to realise. I had an extra space character before the thumbprint string which was the cause of the error. Even after fixing that though I then got another error: No certificates were found that met all the given criteria. Running the command again with the /debug option listed all of the certificates it attempted to use and After Hash filter, 0 certs were left. The hash SHA1 hash for the certificate I wanted to use was exactly the same as I specified with the only exception being that the hash was all in upper-case letters. So tried the command again with the hash in all upper-case letters and... it worked. As I haven't seen this requirement documented anywhere I thought I'd provide the answer here.
92068772ea49d4aaf04c585ffaf78a9d08b496ca3216a203da6a3f9e6c1816fc
['a9428878e95d4b84be7130d05c70bc32']
Not saying they should be removed. And yes there are tags for specific versions but as I said more often than not the more generic version-less tags are used and you can't add tags to answers. Plus people like me with not enough reputation can't modify answers to say that the answer is for a specific version. It may surprise some people here but the majority of SO users have no or very little rep so they are unable to contribute by saying "this doesn't work in version X" without adding a new answer (which is actually quite a barrier for a lot of users).
a9b9bccf416d59a918b4bf8bb4d51179f65492261cb1059c2fccbd7517d43a19
['a94311d279834757ad5d10ce0add1457']
I have values in database witch is a percentage values for example: Per columns : 90,85,38,70,85 I select “Per” as the value to be shown in the bar chart But when I run my crystal report all my bar display as 100% It does not take the exact value of “Per” How can I solve this problem?
277c1b4bb259889071a5a615f4c753683d28585d54f22ec3d56d6989cd07eec2
['a94311d279834757ad5d10ce0add1457']
I have database with column of date type My computer run on date format MM/dd/yyyy "en-us" I have grid view which I used to insert data from GV to data base using the insert SQL command it work fine with out any exception. When I try to change my computer date format to dd/MM/yyyy it give my exception when I run my application ("Does not allow to insert data from GV to data base column of date data type") How can I solve this exception any help please?
53dfb2152d089730660e53264a11ee9640157b707729618c5cedb305151f9434
['a945b2d776cf4b64b18f7dd22441590b']
You can write both algorithms with a complexity O(n) where n is the number of characters in the String but there are much better algorithms to do that. By the way I wrote an example that show you the computing time, one method is faster than the other but they are both, as I said, O(n) public class ComplexityTester { //FIRST METHOD public static String replaceSpacesArray(String str) { str = str.trim(); // leading and trailing whitespaces omitted char[] charArray = str.toCharArray(); String result = ""; for(int i = 0; i<charArray.length; i++) // it replaces spaces with %20 { if(charArray[i] == ' ') //it's a space, replace it! result += "%20"; else //it's not a space, add it! result += charArray[i]; } return result; } //SECOND METHOD public static String replaceSpacesWithSubstrings(String str) { str = str.trim(); // leading and trailing whitespaces omitted String[] words = new String[5]; //array of strings, to add substrings int wordsSize = 0; //strings in the array //From the string to an array of substrings //(the words separated by spaces of the string) int indexFrom = 0; int indexTo = 1; while(indexTo<=str.length()) { if(wordsSize == words.length) //if the array is full, resize it! words = resize(words); //we reach the end of the sting, add the last word to the array! if(indexTo == str.length()) { words[wordsSize++] = str.substring(indexFrom, indexTo++); } else if(str.substring(indexTo-1,indexTo).equals(" "))//it's a space { //we add the last word to the array words[wordsSize++] = str.substring(indexFrom, indexTo-1); indexFrom = indexTo; //update the indices indexTo++; } else //it's a character not equal to space { indexTo++; //update the index } } String result = ""; // From the array to the result string for(int i = 0; i<wordsSize; i++) { result += words[i]; if(i+1!=wordsSize) result += "%20"; } return result; } private static String[] resize(String[] array) { int newLength = array.length*2; String[] newArray = new String[newLength]; System.arraycopy(array,0,newArray,0,array.length); return newArray; } public static void main(String[] args) { String example = "The Java Tutorials are practical guides " +"for programmers who want to use the Java programming " +"language to create applications. They include hundreds " +"of complete, working examples, and dozens of lessons. " +"Groups of related lessons are organized into \"trails\""; String testString = ""; for(int i = 0; i<100; i++) //String 'testString' is string 'example' repeted 100 times { testString+=example; } long time = System.currentTimeMillis(); replaceSpacesArray(testString); System.out.println("COMPUTING TIME (ARRAY METHOD) = " + (System.currentTimeMillis()-time)); time = System.currentTimeMillis(); replaceSpacesWithSubstrings(testString); System.out.println("COMPUTING TIME (SUBSTRINGS METHOD) = " + (System.currentTimeMillis()-time)); } }
8e790ede992ea681e1297797bad588b4b13452eda195016138c37afc9d6b5460
['a945b2d776cf4b64b18f7dd22441590b']
You can use a Scanner to separate the tokens of a single line. String str = "57363 Joy Ryder D D C P H H C D"; Scanner tokens = new Scanner(str); String studentID = tokens.next(); String name = tokens.next(); String surname = tokens.next(); String letters = ""; while(tokens.hasNext()) { letters = letters + tokens.next() + " "; } System.out.println("ID = " + studentID + "\nNAME = " + name + "\nSURNAME = " + surname + "\nLETTERS = "+ letters);
0f7a74bec012d7ba5864b76ed6c9011764234299a23be3908f3575091f502803
['a9465e3786bc4b959cd8c13f9cc22762']
I am creating an android app using Google Maps Api v2 targeted for Android Api 16+ compiled using Api 23. I am having a strange problem. When I tested the app on my phone; installing through Studio's Run button, It work perfectly fine, but when I released an APK and installed the app from the APK on my phone, map does not work. Only a dark grey color loads in the map fragment. I am using the default template provided by the AndroidStudio to create the Map. Please, let me know if you require more details to answer my question. Thanks in advance, <PERSON>
e2c4978f8838f8875826b62da828acea421b9ae2ce5e162860e9035c04babebb
['a9465e3786bc4b959cd8c13f9cc22762']
I am loading some data from a database table in a datagrid in Flex and I require a custome component on the first empty row or on empty rows, so user can add data in to that row. How can I do that? I do not want to make the datagrid column editable.
e6f042a5443e0eed06eb186e12ed20fe9aaaa2cb9d05171ba0fc6c9f786a611b
['a96a4bc8a7994969b99b3f086689fadf']
So I managed to perform a rebase and pushed the changes to Gitlab but now I am getting errors and would like to cancel the whole rebase and go back to where I started. I am working on a "feature-branch" and I did the rebase to "develop" branch. What I did was: Git checkout feature-branch Git rebase develop Git push -f origin feature-branch So now both my local branch and the remote branch contains the changes from the rebase. Is there anyway I could cancel the whole rebase and push -f and try to do it again? Thanks!
39bb554cd68e999c18b2d0cce59fd1422277dcf29337bd0311b04310d4f8f8c4
['a96a4bc8a7994969b99b3f086689fadf']
I have a vector of maps. Each map has three keys :x, :y and :z. I want that the value of :z would be the sum of the values of keys :x and :y. How should I do this? i.e. [{x: 5 :y 10 :z (+ :x :y)} {...} {...}] In the above example, the first map's :z value should then be (+ 5 10) = 15. Thanks for helping!
7a2cfd491b15372771f4d301bcdefdc51a826d7f8543ca432a72cd46dd2eda6f
['a986217687944a43a6b5b33dac4fbabf']
For Helm chart, since builds run on LOW cpu and memory by default, you can configure the default LOW values under the queue section in the values.yaml file. To use less CPU and MEMORY in your Screwdriver pipeline, you'll need to use screwdriver.cd/cpu and screwdriver.cd/ram annotations in your screwdriver.yaml file. For example, to use micro CPU and MEMORY, you should have something like this: shared: annotations: screwdriver.cd/cpu: MICRO screwdriver.cd/ram: MICRO
25b609b19f576c3a51b2e8d5353ae529b0a075fc5bc73065b8938591457840ed
['a986217687944a43a6b5b33dac4fbabf']
If you are using SD-in-a-box to spin up your own instance, there should be text telling you what to put for Homepage URL and Authorization callback URL, like in this example: https://docs.screwdriver.cd/cluster-management/running-locally. But basically, Homepage URL should be your local UI URL (for example, http://localhost:9000). Authorization callback URL should point to your local API with /v4/auth/login appended to the end (for example, http://localhost:9001/v4/auth/login).
0302a5e7458ae95e5cfd101e8222951d723ffdf572872b0773157c4ad422347b
['a987ec277fca4ee5a99d99f22cc2ef4a']
I create mathematics workbooks in Microsoft Word. Typing in each equation is slow but faster than LaTex. So, I often copy content from a website like LibreTexts. If I copy a section that contains equations it comes out garbled. So, I go to each equation, right click, hover over Show Math As, select MathML code, select all (Ctrl+a), copy (ctrl+c), close window (Ctrl+w), go to word (Alt-Tab), paste as plain text (Ctrl+Shift+v), go back to Chrome browser (Alt-Tab), then repeat the process. This can be faster than typing by hand, but there has to be an easier way. There was a post similar to this one, but I don't know what extension was referred to and I don't know java. If your solutions contains the step "learn basic Java here", that is fine. If this is the incorrect Stack Exchange, please suggest the correct one. Thank you.
5881fa664e62bc08ce53e1080df95b149081ba5f219ba9ae7e1685d5492d3422
['a987ec277fca4ee5a99d99f22cc2ef4a']
You can directly construct MyPojo by giving it the map. Something like MyPojo pojo = new MyPojo(map); And declaring an according constructor : public MyPojo(Map<String, Object> map){ this.number=map.get("number"); this.string=map.get("string"); this.pojo2=new MyPojo(); // I don't know if this is possible this.pojo2.string=map.get("pojo2").get("string"); this.pojo2.number=map.get("pojo2").get("number"); }
b79b295a8917e12786998c9417a580002dcaf3a31868d33c8362ce99d964b9fb
['a9a2bd9d85574800bb018a87a9e4c922']
I have this process, the user selects 2 dates. The system will then check if there are weekends. Weekends are: Friday Saturday Sunday Every time there are weekends, there would be additional charge + $10 PER DAY OF THE WEEKEND. I have this code below, what I want is the process to add the surcharge. http://jsfiddle.net/xtD5V/71/ function isWeekend(date1, date2) { var d1 = new Date(date1), d2 = new Date(date2), isWeekend = false; while (d1 < d2) { var day = d1.getDay(); isWeekend = (day == 6) || (day == 0); if (isWeekend) { return true; } d1.setDate(d1.getDate() + 1); } return false; } alert(isWeekend(date1, date2));
1097ef2dc7b84d27c335a228b5195ea92e5cb6432af36f7c01e31ff7cd9a0df5
['a9a2bd9d85574800bb018a87a9e4c922']
I have created my own table on my wordpress database and created the filter search form. Now, my problem is that, I dont know how to connect my database to my search filter form in wordpress. Here is the process, I send the keyword from index.php to result.php, and it shows nothing, just a blank page. Here's my code: <?php define('WP_USE_THEMES', false); global $wpdb; $destination = $_POST["destination"]; echo "Welcome test" . $destination; $sql = "SELECT * FROM rates WHERE location = '" . $destination ."';"; echo $sql; echo "search this"; foreach ( $wpdb->get_results($sql) as $result ) { echo "search for". $result->location; } ?>
a3cbb0860449ec20b8746849e9230cebc1dab8d8d17394450b94682f6592b650
['a9a2d24555de4aeeb1cd04aa8ff337c7']
I registered a developer account and added a game. Then I added the client id and secret to the app with [Everyplay setClientId:xxx clientSecret:xxx redirectURI:xxx]; and tried to upload a video. But it showed the example app instead of the name and icon of my game. Did I miss some steps? Or is this normal behaviour for development build? Thanks.
f2062071b56467aed8ad7db4c3b98b354e9dffda1356eefb614eb56da0f75e70
['a9a2d24555de4aeeb1cd04aa8ff337c7']
I'm writing a program for IOS and want to get uid and name of the current user. I tried me(), but it does not return any value: SELECT uid, name FROM user WHERE uid = me() However it works when the uid is known, for example: SELECT uid, name FROM user WHERE uid = 4 Does me() require permission?
a43e8bbf10c39e07ce69f117f8398e4fd74db4aded2dc285800f604c62a68425
['a9a4019b13044a11aeb8436d8e4ef683']
I have two monitors. One is horizontal and one is vertical. I like to split my vertical monitor into up and down, so that I can have two windows on it, one on the upper part and one on the lower part. How can I do this? I know one can use (super + arrows) to send a window right or left.
758c7bf55fa41af15ccaa53daaf88c43ce18f7fabf5c0d531dda9a5c92cc9dcc
['a9a4019b13044a11aeb8436d8e4ef683']
Trying to put the system into hibernate (deep sleep where RAM is written to disk), generated the following error $ sudo systemctl hibernate Failed to hibernate system via logind: Sleep verb not supported The following steps resolve the issue (Tested on Thinkpad X1 Carbon 7th Gen, Ubuntu 19.10). Most of them are borrowed from here. Turn off Secure Boot in BIOS. Set "Sleep State" to Linux in BIOS. This options was originally named "Modern Standby" in my BIOS and I had to turn if off, but after a BIOS name the name was changed to "Sleep State". Create a swap file equal or bigger than RAM. Several steps are involved here which are as follows. a. Turn off swap. $ sudo swapoff -a b. Create a file bigger or equal to the RAM. Mine is 16GB, so: $ sudo dd if=/dev/zero of=/swapfile bs=1G count=16 16+0 records in 16+0 records out <PHONE_NUMBER> bytes (17 GB, 16 GiB) copied, 19.3685 s, 887 MB/s c. Set the right permissions for the file: $ sudo chmod 600 /swapfile d. Make the file as swap: $ sudo mkswap /swapfile Setting up swapspace version 1, size = 16 GiB <PHONE_NUMBER> bytes) no label, UUID=3b2e6f0c-ce12-4a84-9044-d99bfba059ea e. Turn on swap and check if it is set properly: $ sudo swapon /swapfile $ cat /proc/swaps Filename Type Size Used Priority /swapfile file <PHONE_NUMBER> f. In order to make the swap be loaded after reboot, we have to add it to /etc/fstab. Thus run the following command to open the file: $ sudo gedit /etc/fstab And update it by adding the last line like below. Note that I have also commented my original swap as I don't need it. /dev/mapper/vgubuntu-root / ext4 errors=remount-ro 0 1 # /boot was on /dev/nvme0n1p2 during installation UUID=d265e7c4-1a4f-49c4-af29-fea2543490d7 /boot ext4 defaults 0 2 # /boot/efi was on /dev/nvme0n1p1 during installation UUID=0004-FB5F /boot/efi vfat umask=0077 0 1 #/dev/mapper/vgubuntu-swap_1 none swap sw 0 0 /swapfile none swap sw 0 0 g. Do a reboot and run this command to see if the swap shows up: cat /proc/swaps Filename Type Size Used Priority /swapfile file <PHONE_NUMBER> Now, it's time to update the grub. a. Run this command to open grub: $ sudoedit /etc/default/grub b. Find where root is mounted by running the following command. $ mount | grep " / " /dev/mapper/vgubuntu-root on / type ext4 (rw,relatime,errors=remount-ro) c. So mind is mounted on /dev/mapper/vgubuntu-root. Find the UUID of this location by running: $ sudo blkid /dev/mapper/nvme0n1p3_crypt: UUID="AZrE57-dlNc-BiUr-RrTF-SdT2-luVK-vrliNq" TYPE="LVM2_member" /dev/mapper/vgubuntu-root: UUID="2331fe68-3e7a-4937-9cfa-74fc7a4b79f6" TYPE="ext4" /dev/nvme0n1p1: UUID="0004-FB5F" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="09813156-6b7a-4fc2-b644-a8c6b7d40abf" /dev/nvme0n1p2: UUID="d265e7c4-1a4f-49c4-af29-fea2543490d7" TYPE="ext4" PARTUUID="64f5da2f-71d3-4f02-9b1e-3e12d7f6c445" /dev/nvme0n1p3: UUID="201acba5-ff20-46ee-9000-34efefef3fbe" TYPE="crypto_LUKS" PARTUUID="16858e70-eb08-4de8-b944-50689cad9d9f" /dev/sda1: LABEL="ST64GB" UUID="624AB7B308FE9F38" TYPE="ntfs" PTTYPE="dos" /dev/mapper/vgubuntu-swap_1: UUID="af3b29a2-ba6b-44de-89dd-072f4233aaf9" TYPE="swap" The UUID in this case is 2331fe68-3e7a-4937-9cfa-74fc7a4b79f6. Keep this UUID. d. Next, we need to find the offset of the swap file. Run this command: $ sudo filefrag -v /swapfile Filesystem type is: ef53 File size of /swapfile is <PHONE_NUMBER> (4194304 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 32767: 835584.. 868351: 32768: 1: 32768.. 49151: 868352.. 884735: 16384: 2: 49152.. 81919: 886784.. 919551: 32768: ... We look for the pysical_offset of the first block. In the above case, it will is 835584. Keep this number too. e. We need to update the grub now. Run the following command: $ sudoedit /etc/default/grub Update with the following content. We update GRUB_CMDLINE_LINUX_DEFAULT and add GRUB_RECORDFAIL_TIMEOUT=0. # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE=hidden GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=2331fe68-3e7a-4937-9cfa-74fc7a4b79f6 resume_offset=835584" GRUB_CMDLINE_LINUX="" # Avoiding grub to show up in boot when resuming from hibernation GRUB_RECORDFAIL_TIMEOUT=0 f. Once the grub file is updated, run this command: $ sudo update-grub That should be it. Now you can put the system into hibernation by running $ sudo systemctl hibernate
9d213c14509b1f54f9f1f26fd542dd4d5c86ffa2ceb4ec17f79a08e60762550c
['a9d72b54531e4e8f92493ec18093a3d9']
I have some custom assemblies installed in GAC but when I try to check the existence of these using MSBuild task, it shows False. But, it does show the existence of framework assemblies. Here is my task: <Target Name="CheckGAC"> <MSBuild.ExtensionPack.Framework.Gac TaskAction="CheckExists" AssemblyName=Service.Common, Version=<IP_ADDRESS>, Culture=Neutral, PublicKeyToken=ed9f5fb552f617d7"> <Output PropertyName="AssemblyExists" TaskParameter="Exists"/> </MSBuild.ExtensionPack.Framework.Gac> <Message Text="Exists: $(AssemblyExists)"/> </Target> Is there any reason it doesn't work with user assemblies in GAC ? or any other way to check if my assembly exists in GAC using MSBuild?
e4bc3b8b8d5b7d8d6965325dbd1e37ec1e2da562a081350ac17e742af640442c
['a9d72b54531e4e8f92493ec18093a3d9']
Ok. So here is the solution I found: I used TemplateWizard to customize my folder structure. Create the projects with default project name and containing folder. Create SolutionFolder using TemplateWizard. Remove projects from Solution. Rename the containing folder. Add the project to SolutionFolder which I created in Step 2. Hope this helps someone with similar issue.
574bebe8fe65b015bee06aee5f2bff5fb949bb9f22e26d446bfbc20dedf4561c
['a9da1143f21b49448e04922014972bb4']
I'm actually working on a software powered by GTK# 2.12, we have some memory leaks on it and I'm searching how to improve that. I made a small app to test the correct way to get rid of a widget. I'm creating 10 000 Labels and then I delete them. Here's my Label class: namespace test_gtk_objects { public class TimeLabel : Label { private bool disposed = false; protected DateTime _time; public TimeLabel(DateTime time) { Time = time; } ~TimeLabel() { Dispose(false); Console.WriteLine("Called dispose(false) of class" + this.ToString()); GC.SuppressFinalize(this); } //dispose public override void Dispose() { // Console.WriteLine("Called dispose(true) of class" + this.ToString()); Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposed) return; if (disposing) { Hide(); Unrealize(); Unparent(); Unmap(); Destroy(); Unref(); Console.WriteLine("ref: " + RefCount.ToString()); // Free any other managed objects here. // } disposed = true; base.Dispose(); } protected void display(Label input_label) { input_label.Text = _time.ToString("HH:mm:ss"); } internal DateTime Time { get { return _time; } set { if (_time != value) { _time = value; display(this); } } } } } as you can see I have overridden the dispose method as suggested. I also tried some way to free most of the widget (especially with the unref() ) to be sure the widget is not linked to something else. In my main window, I just create thoses labels in à list and remove them by calling the Dispose method on each of them. All my widgets seem to be deleted, but I always have some Glib. toggleref, Glib. Signal as you can see in my memory snapshot: Memory snapshot I don't have an idea how I can get a rid on it if you can help me with that problem it will be very appreciated <PERSON>
17bb7e1840516c04102cfea44917768c5fa5c1590d71abeed082b583b0caa4bc
['a9da1143f21b49448e04922014972bb4']
You have to create a signal to your button like this: Button button = new Button(); button.Clicked += Button_Clicked; private void Button_Clicked(object sender, EventArgs e) { //some stuff } It will work correctly. This is the way you must use Button widget. Sometimes it's depending how you layout your app, some widgets can be on your button and it can make unwanted behaviors.
c8b83c88709128118b381490ef33543542cfb6a069a109e4d1da730b8c234543
['a9dda6e7b709414389391596f75a02db']
I would like to use a single XSL to produce multiple output formats (xml and html for now) I would like to define which output format by means of a stylesheet So the code I have is as follows: <xd:doc scope="stylesheet"> <xd:desc> <xd:p><xd:b>Created on:</xd:b> July 1, 2015</xd:p> <xd:p><xd:b>Author:</xd:b> me</xd:p> <xd:p>A stylesheet to test the application of XYZABC</xd:p> <xd:p>takes a single parameter - xslt_output_format</xd:p> <xd:p>valid inputs - xml html</xd:p> </xd:desc> </xd:doc> <xsl:output name="xml_out" encoding="UTF-8" indent="yes" method="xml" /> <xsl:output name="html_out" encoding="ISO-8859-1" indent="yes" method="html"/> <xsl:template match="/"> <xsl:choose> <xsl:when test="$xslt_output_format = 'xml'"> <data> <p>This is some test xml output</p> </data> </xsl:when> <xsl:when test="$xslt_output_format = 'html'"> <html> <head> <title>HTML Test Output</title> </head> <body> <p>This is some test html output</p> </body> </html> </xsl:when> </xsl:choose> </xsl:template> </xsl:stylesheet> If I pass 'xml' as the parameter I get This is some test xml output and if I pass 'html' I get HTML Test Output This is some test html output That doesn't seem to respect my respect for ISO-8859-1 encoding on the html (which I was just using to test the was working) <PERSON> XSLT 2.0 and Xpath 2.0 tome is a little vague and definitely short of examples on using multiple statements (sorry <PERSON>) So I am just asking am I using it correctly? Can I achieve what I am aiming for? <PERSON>
5e2d9d74cbff2c74db9bd9fc054304cb8e25eb5e0f5921bbeed1d9c2471f2cd7
['a9dda6e7b709414389391596f75a02db']
Platform: Saxon 9 - XSLT 2.0 I have 3000 xml docs that need to be regularly edited, updated and saved. Part of the process involves checking-out a document from a repository before editing, and publishing it at regular intervals when editing is complete. Each document contains a series individually named sections e.g. <part> <meta> <place_id>12345</place_id> <place_name>London</place_name> <country_id>GB</country_id> <country_name>United Kingdom</country_name> </meta> <text> <docs>some blurb</docs> <airport>some blurb LGW LHR</airport> <trains>some blurb</trains> <hotels>some blurb</hotels> <health>some blurb</health> <attractions>some blurb</attractions> </text> </part> Within the text element there are nearly 100 sections, and as with all editorial teams, they change their mind on the preferred order on an occasional, but regular, basis. Maybe twice per year. At the moment, we present the XML doc sections to the editors IN THE CURRENT PREFERRED ORDER for editing and for publishing. This order is specified in a dynamically generated external document called 'stdhdg.xml', and appears something like this: <hdgs> <hdg name="docs" newsort="10"/> <hdg name="airport" newsort="30"/> <hdg name="trains" newsort="20"/> <hdg name="hotels" newsort="40"/> <hdg name="health" newsort="60"/> <hdg name="attractions" newsort="50"/> </hdgs> where the preferred sort-order is specified by hdg/@newsort. So I use a template like this to process in the correct order <xsl:template match="text"> <xsl:variable name="thetext" select="."/> <xsl:variable name="stdhead" select="document('stdhdg.xml')"/> <text> <xsl:for-each select="$stdhead//hdg"> <xsl:sort data-type="number" order="ascending" select="@newsort"/> <xsl:variable name="tagname" select="@name"/> <xsl:variable name="thisnode" select="$thetext/*[local-name() = $tagname]"/> <xsl:apply-templates select="$thisnode"/> </xsl:for-each> </text> </xsl:template> But it seems very slow and cumbersome and I feel that I should be using keys to speed it up. Is there a simpler/neater way of doing this sorting operation. (Please don't ask me to change the way the editors edit. That is more than my life's worth) <PERSON>
e69f3a14a760086695b2ec14e0d42556adcf91531113d71cb01751ac9b5d9563
['a9e46950d7e549deb5d416d49673969d']
Good point. I did specify the path and row too, but just to make sure I had a quick look on the [landsat viewer](http://landsatlook.usgs.gov/viewer.html) - There are only the 17 results you are after there too. Sorry but I think that this is just all there is!
c4296601314cfc172932ed4465557ba748ca05ab95fbd161712d654bae721abe
['a9e46950d7e549deb5d416d49673969d']
The company I work for have a free email-service (like Hotmail/Gmail) with about 50.000 users. The service is currently hosted by a partner, but would like to know what options we have for setting up our own servers and hosting a web-mail-interface etc. There are no platform (windows, Ubuntu etc) preferences. What servers would you recommend?
075e1f0d4e69f254919e81764e3b6b1dedfe7efe9a91acca5b98ef8465dc502f
['a9eb3f2d67bb4c158843dffc3dae630e']
This works fine: Router.route('/', function () { this.render('home'); }); Router.route('/about', function () { this.render('aboutView'); }); However, this gives an error (RouteController 'HomeController' not defined): var HomeController, MainController; HomeController = RouteController.extend({ action: function() { this.render('home', { }); } }); MainController = RouteController.extend({ action: function () { this.render('aboutView', { }); } }); Router.route('/', {name: 'home', controller: 'HomeController'}); Router.route('/about', {name: 'about', controller: 'MainController'}); I've tried various permutations (taken from the IronRouter documentation) but there is still the same error. What am I doing wrong?
3646f086b516b2f338b899e10a4c58f5d209f3fcf7e7a2fc9b67ae7c30825699
['a9eb3f2d67bb4c158843dffc3dae630e']
I've just downloaded the latest Nativescript Sidekick. When I try to run it, I get the message that it is expecting: "NodeJS >=8.0.0 <=10.5.0" I'm using nvm, so I can switch node versions at will, but Sidekick appears to ignore this and pick up the latest (10.9.0 in my case). How does Sidekick detect the nodejs version? And how can I persuade otherwise???
fe374c54ebe85637ff8d034f6f1f160e3bf3eb217a7537a1d54d0fd19d7dc715
['aa008919ad764d06a4d273c020b67f1e']
Thank you for asking this question. I have learned quite a bit by reviewing it. That said, I think I understand what you are trying to ask. If I understand you correctly, you are attempting to implement and control implicit instantiation with your function template. Although the example you posted here is of operator<< overloading, the mechanism underlying this generic programming using template is the same for function template implementation. When you state cout << my_container, what you are instantiating is the overloaded operator<<. But if you want to instantiate a non-template stream object, you would have to modify what you are trying to read from. Since the class data member value is private, you could use a pointer to explicitly point to that data member and use that pointer to instantiate a non-template stream object. Take a look at the following example: int* private_value = (int*)&my_container; The *private_value should allow you to access the private member despite the encapsulation. If you want to enhance the security of data members, then deeper encapsulation is necessary to prevent such an implementation. Template argument deduction can be achieved (if that is what you are seeking) by perhaps including a get() function and accessing value, thereby instantiating a non-template stream object.
b8c69106a0995d84968ba4cc6dc6b6f08fbd082b77381004f2644779389e877d
['aa008919ad764d06a4d273c020b67f1e']
To get straight to your point of concern, I do agree with your question: Wouldn't there be some sort of memory leak if you place curl_easy_cleanup(curl); after falling out of scope and returning 1 to the main() program? As a disclaimer, I have not looked at the curl.h and how libcurl destroys its objects after program exits. In general, when a program exits, theoretically memory is automatically freed if in stack. If in heap (or free space), however, it is the programmer's responsibility to deallocate and free the memory. Keeping in mind that handle is a pointer with a possibility of dynamic allocation of memory and assuming that the purpose of both curl_easy_cleanup() and curl_global_cleanup() is to delete and reset pointers so that they don't become dangling pointers, going just by the code, exiting the program with an error of one without freeing memory is a concern for memory leak.
7061ebf70f91882888df8af6162aff97112d256918123a84af0fbc12d9984e08
['aa0140203d1549fd984f4bddf851c751']
I am not sure this question belongs here but I have no idea where else to ask help for this problem. I am experiencing weird behavior from my Dell Inspirion 5570, win 10 Home student license, regarding the wireless driver on a certain network. This type of behavior does not happen on my home network( which is slower than this network as it doesn't reach 100Mbps) or on mobile hotspot or any other network I have tried. Behaviour: it doesn't have the upload/ download speed as fast as the network is,I have tested this with another laptop(Huawei MateBook D14 2020 ) which gets up to 200-300Mbps on wireless network and close to 500Mbps on LAN , both tests done with ookla speedtest. it stops browser pages like facebook, youtube, discord from loading and appears to have an error on the network but other pages or searches ar fine at the same time( for ex: I can search any word or meaning or go to shopping pages but I can't access facebook's feed in the same browser or on different browsers, I have tested both) I believe it is an issue with the driver for networks, I have tried updating it, rollback, change setting on it but nothing seems to work. The driver is : Qualcomm QCA9377 802.11ac Wireless Adapter Looked up on dell.com support for another driver for this laptop but this is the only one and I have the latest version. I have no idea where to go next or how to solve this, any help is appreciated. Thank you!
6dccd4e71f669f9065901ae3407e9bb29bfc80bf1126af94ac27df44ff2cbe0b
['aa0140203d1549fd984f4bddf851c751']
I tried with a USB adapter, the same one used for the Huawei laptop but it didn't changed anything. I also used the ethernet port on the laptop for wired networking but no results. It's weird because the desktop apps work, it's just the browsers that don't want to work.
3a7b187df52f52bab567cfc7c5d870a7ff4056f4d43a716a9056482ff0c3b681
['aa1fbc6478054f9fbea7bb0084037065']
In VBA what's the best way to declare a Public constant collection/dictionary of elements with multiple properties like this? Dim fruits as new dictionary fruits.add "banana", array("yellow", "long", "curved") fruits.add "watermelon", array("red", "big", "sferic") fruits.add "blueberry", array("blue", "little", "sferic") I could change the Dim fruits as new dictionaryintoPublic fruits as new dictionary moved on top (outside procedure) but how could I populate this dictionary once for multiple sub/functions that will use it? I could put all the three "add" instructions in a dedicated sub called "fruits_populate()", and call this sub at the beginning in each sub/function where I use it but is there a better solution?
5ddcc7753cb7c4e19ee38aa1db9464844afcdbaf2798a7e368838b837ab1be1a
['aa1fbc6478054f9fbea7bb0084037065']
Dim objList As WbemScripting.SWbemObjectSet Set objList = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='iexplore.exe'") This code returns a collection of SWbemObjectEx objects relating to all the running processes "iexplore.exe" (as seen in task manager). I read on the web that I can run the method .Terminate of these objects to kill them. However, neither the Locals window while in breakmode nor the Object Browser for the "SWbemObjectEx" class, nor the official doc at https://learn.microsoft.com/it-ch/windows/win32/wmisdk/swbemobjectex, show this method .Terminate. And what surprises me is that it works, although not for all the objects... Why? and how could I see all these hidden(?) methods for this class?
e5fd9499ed94996b766e0841f13fe8fc9264e6e0d7789d9d831a5a1a90bc8d43
['aa2021ba683d458dae5f69cb5700d44e']
I have a Dell XPS 13 9300 with Debian 10. I was experiencing the same issue as the user Marc on this thread: the laptop would hang with a blank screen before completing shutdown/reboot, forcing me to hold the power button to turn it off. In the thread, the following solution is suggested: in the BIOS settings, under the "Virtualization" section, disable the option "VT for Direct I/O". It did solve the shutdown problem. However, for some weird reason, after rebooting I lost my WiFi connection. Internet still works with an ethernet cable, but no wireless. After trying a couple solutions in vain, I re-enabled the VT option. Here is the result of sudo lshw -C network (after enabling the option again): *-network description: Wireless interface product: Killer Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW) vendor: Intel Corporation physical id: 14.3 bus info: pci@0000:00:14.3 logical name: wlp0s20f3 version: 30 serial: 04:33:c2:1a:68:c3 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=5.6.0-1-amd64 firmware=48.13675109.0 Qu-c0-hr-b0-48.uc ip=<IP_ADDRESS><PERSON> on this thread: the laptop would hang with a blank screen before completing shutdown/reboot, forcing me to hold the power button to turn it off. In the thread, the following solution is suggested: in the BIOS settings, under the "Virtualization" section, disable the option "VT for Direct I/O". It did solve the shutdown problem. However, for some weird reason, after rebooting I lost my WiFi connection. Internet still works with an ethernet cable, but no wireless. After trying a couple solutions in vain, I re-enabled the VT option. Here is the result of sudo lshw -C network (after enabling the option again): *-network description: Wireless interface product: Killer Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW) vendor: Intel Corporation physical id: 14.3 bus info: pci@0000:00:14.3 logical name: wlp0s20f3 version: 30 serial: 04:33:c2:1a:68:c3 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=5.6.0-1-amd64 firmware=48.13675109.0 Qu-c0-hr-b0-48.uc ip=192.168.1.87 latency=0 link=yes multicast=yes wireless=IEEE 802.11 resources: iomemory:600-5ff irq:16 memory:603dbb4000-603dbb7fff Any suggestions?
c357264a9e3ab1c0b64f0e2a33678f5aff5b973484c88819ff311d9e46339dbc
['aa2021ba683d458dae5f69cb5700d44e']
I have run heif-convert successfully not long ago but now I get this error: >heif-convert bob.heic bob.jpeg heif-convert: symbol lookup error: heif-convert: undefined symbol: jpeg_write_icc_profile, version LIBJPEG_6.2 Any idea how to fix this? I'm running Debian 10 testing. Apparently I have the newest versions of the packages libheif-examples and libjpeg62-turbo installed.
9e001df9632f93cc2a91c6d18826b800663e13758d41583efa5e16fd268b4dae
['aa211548de154415a28fe5279c506867']
So first things first: you are not including the dropdown with $attributes inside the for loop. Second: validation. Do you validate you user input? Take a look here (http://www.codeigniter.com/userguide3/libraries/form_validation.html#form-validation-tutorial) if you're using Codeigniter 3.0 or here https://ellislab.com/codeigniter/user-guide/libraries/form_validation.html if you're using the old one, even though they should be more or less the same. Third: Drop the use of $_POST['user'] and use $this->input->post('user');, CodeIgniter will filter the data, if you enabled XSS filtering, and will return false if the value is not set. Forth: Separate your logic if you're using an MVC framework. Move the insert in the model and pass it the data from the controller. Bonus Take a look at $this->db->insert_batch() $data = array( array( 'title' => 'My title' , 'name' => 'My Name' , 'date' => 'My date' ), array( 'title' => 'Another title' , 'name' => 'Another Name' , 'date' => 'Another date' ) ); $this->db->insert_batch('mytable', $data);
8ede9ba701094d6a27ae8d9f5e6bc3a0174641c092bdc9ec30cf00ac2836fd4b
['aa211548de154415a28fe5279c506867']
Ended up dropping the date_histogram aggregation and using the date_range one. It's much easier to work with, even though it does not return the difference compared to yesterday's same time period. I did that in code. { "size": 0, "query": { "bool": { "filter": [ { "term": { "type": "toBeMonitored" } }, { "term": { "status": true } }, { "range": { "@timestamp": { "gte": "now-1d/d", "lte": "now/h" } } } ] } }, "aggs": { "ranged_documents": { "date_range": { "field": "@timestamp", "ranges": [ { "key": "yesterday", "from": "now-1d/d", "to": "now-24h/h" }, { "key": "today", "from": "now/d", "to": "now/h" } ], "keyed": true } } } } This query would yield a result similar to the one below { "_shards": { "total": 42, "failed": 0, "successful": 42, "skipped": 0 }, "hits": { "hits": [], "total": { "value": 10000, "relation": "gte" }, "max_score": null }, "took": 134, "timed_out": false, "aggregations": { "ranged_documents": { "buckets": { "yesterday": { "from_as_string": "2020-10-12T00:00:00.000Z", "doc_count": 268300, "to_as_string": "2020-10-12T12:00:00.000Z", "from": 1602460800000, "to": 1602504000000 }, "today": { "from_as_string": "2020-10-13T00:00:00.000Z", "doc_count": 251768, "to_as_string": "2020-10-13T12:00:00.000Z", "from": 1602547200000, "to": 1602590400000 } } } } }
960b17759f42cd70e237bba9a2e954dfabf943adacd86f1d031060f07ab5a96f
['aa278da2b4074736956d736f864e1443']
В переменной хранится некое значение количества аудитории. Отображается в формате: "Аудитория: 81345" (например). Как сделать так чтобы после тысяч был пробел, то бишь в формате "Аудитория: 451 834". Сделал пробел после каждой третьей цифры, но способ не универсальный т.к есть цифры как 8612 где данный способ не сработает. Способ: $str = chunk_split($rows['value'], 4, ' '); А вот сама переменная: <strong>Аудитория: <?= $all_views ?></strong> <br>
9c19d168c60046b8d99d6a8678d7f9a6e1aaafd62f914f1ee3f20a495ebacb22
['aa278da2b4074736956d736f864e1443']
Скрипт не работает на айфон 6 и ниже. На тех, что выше - всё идеально let payBtn = document.getElementById("pay"); payBtn.addEventListener("click", (e) => { e.preventDefault(); let data = { "_csrf-frontend": csrfInput.value, email: document.getElementById("email").value, orderID: window.createdOrderID, }; $.ajax({ url: "/redirect-to-pay", type: "post", data: data, dataType: "json", success: function (result) { console.log(result); if (result.hasOwnProperty("errors")) { //показать Alert } else { document.location.assign(result["link"]); } }, }); });
6d2b73873602236a673eb312a002429122ca847605644661a76b73bd873b7566
['aa3f6cee856c4ae5ad4080c1ef3045d2']
https://github.com/mackyle/sqlite Above is the source code of SQlite It use tcl script to concat the whole program into a single file sqlite3.c What I am currently doing is I use the tcl script provided to split the huge sqlite3.c (see section 2.0 in https://www.sqlite.org/amalgamation.html#2) and write a cmake script to allow me to debug it in CLion. Is there a better/proper way to do it? It would be nice if I could debug in the original file structure .
6a226a8fd0b4b33d4a4e8dc19f37473a44b159e07e79f1dae3ea2d4e2572f5c9
['aa3f6cee856c4ae5ad4080c1ef3045d2']
Usually when I am not using maven, My project have a tons of library file For example, A normal GAE will have at least 40MB of jar file Should I avoid push this file to the repository ?( and how to avoid it) If not , How can I manage this situation(somethings,I just have a really slow network)
a96a3e658e63f4a444085e26e03f687feb77be9e17f22ab0c81e624f7cc6af59
['aa45233ec3d64e37b99beff78e53e28a']
Também pensei e retirei essa linha de código, o problema é que nem entra rotina do success. Quando chega no success o valor que a função /membros.aspx/populaGridMembros deveria retornar ainda não está retornado, é como se o response ainda não estivesse ocorrido, então quando chega no success o parâmetro result da function está com valor undefined, só depois que ele passa pelo error e termina todos os parâmetros é que a função $.ajax retorna o valores no responseText.
eb11f27a8b57dd3f034e4575765a43e7dd316d411f40c4888adbff6d5d511805
['aa45233ec3d64e37b99beff78e53e28a']
I have two Facebook accounts: A, and B. FB account A uses my real email address and has my real life friends. FB account B uses made up information and is in no way associated with my real life. I recently installed Instagram on mobile using the same email address as FB account B. I have never selected the "Connect to Facebook" or "Connect Contacts" options. Imagine my surprise when I look at my Instagram friend suggestions and see many of my REAL LIFE friends, people who are ONLY associated with FB account A. This means somehow Facebook knows or is assuming that email address B is me even though I have never associated my name or any of my friends' names with it. The only association I can think of is that I connect to Facebook using both accounts on the same devices, and with the same IP address. Otherwise, there should be no association between the two identities. I haven't authorized Instagram to dig into my contacts or share data with Facebook, but somehow an Instagram account with my fake identity is being associated with my real life Facebook account. I know that Facebook owns Instagram, but this feels like some kind of invasion of privacy. I know nothing of legal policy, and would like some advice on how to know if this is legal or not. Thank you for reading this. (side note: my second identity is not being used for any nefarious purposes)
9636850ce6ed6ecdb753730eb5c35cf68464dedc652592ccbf76ae7174fd9640
['aa479fcd4f8a4ef6950ef7e6029fc07e']
I want to set up Radicale for CardDav and CalDav syncing. I set up Apache and want to access Radicale with uwsgi. When I enter the user name it says 'Service Unavailable'. The error logfile shows: [proxy:error] [pid 21029:tid 140292405581568] (111)Connection refused: AH02454: uwsgi: attempt to connect to Unix domain socket /run/uwsgi/app/radicale/socket (radicale) failed [:error] [pid 21029:tid 140292405581568] [client <IP_ADDRESS><PHONE_NUMBER>:33788] AH10101: failed to make connection to backend: httpd-UDS:0 I am running Debian buster. Https traffic seems to work, I get asked for username/password. I took examples/apache2-vhost.conf and just edited the domain/host name and corrected the conf-available file to radicale-uwsgi.conf (bug) and put it into /etc/apache2/sites-available (+ a2ensite ...). I also edited /etc/radicale/config but for me it looks like that it's not coming that far. I have never worked with unix sockets and uwsgi so far, so I am a bit lost now. Can anyone give me some hints? Thank you, Flo.
d10839dc10d6b7bbdb1b4010a2e70cec1bed105accab44f715e749c6f2c3f93c
['aa479fcd4f8a4ef6950ef7e6029fc07e']
To produce a scrollable GTK drawing area (GtkDrawingArea) a scrolled window can be taken (GtkScrolledWindow). The drawing area is a child of the scrolled window (gtk_container_add). However, to scroll the drawing area I need to specify its size every time it changes it (gtk_widget_set_size_request). And, of course, scrolling only makes sense if its size is bigger than the size of the scrolled window. Finally I wanted to use the scroll wheel to zoom into my Cairo drawing. This only works well if the point under the mouse is fixed. So I needed to adjust the scrolled window (GtkAdjustment) not to have the drawing moved under the mouse. Unless when zooming out to the very low levels. However I couldn't find out where these adjustments are set when the drawing areas are changed so I had to do it manually when zooming in. I changed the example in a way that it's working now. The code is complete to run: cf.c: #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include <ctype.h> #include <gtk/gtk.h> #define ZOOMING_STEP 1.2 #define SCALING_FACTOR_INIT 1.0/10.0 typedef struct m_data { double scaling_factor; cairo_surface_t *rectangle_surface_p, *final_surface_p; GtkWidget *window_p, *drawing_area_p; GtkAdjustment *hadjust_p, *vadjust_p; } m_data_struct; static void activate(GtkApplication *, gpointer); static gboolean zoom_it(GtkWidget *, GdkEvent *, gpointer); static gboolean configure_it(GtkWidget *, GdkEventConfigure *, gpointer); static gboolean draw_it(GtkWidget *, cairo_t *, gpointer); int main(int argc, char **argv) { GtkApplication *app_p; m_data_struct my_data; int status; my_data.scaling_factor = SCALING_FACTOR_INIT; my_data.final_surface_p = NULL; app_p = gtk_application_new("calc.foil", G_APPLICATION_FLAGS_NONE); g_signal_connect(app_p, "activate", G_CALLBACK(activate), &my_data); status = g_application_run(G_APPLICATION(app_p), 0, NULL); g_object_unref(app_p); } static void activate(GtkApplication *app_p, gpointer g_data_p) { GtkWidget *frame_p, *notebook_p, *grid0_p, *grid1_p, *drawing_area_p; GtkWidget *scrolled_window_p, *frame0_p; m_data_struct *my_data_p; cairo_t *cr_p; my_data_p = (m_data_struct *)g_data_p; my_data_p->window_p = gtk_application_window_new(app_p); gtk_window_set_title(GTK_WINDOW(my_data_p->window_p), "Fot Calculation"); gtk_container_set_border_width(GTK_CONTAINER(my_data_p->window_p), 8); notebook_p = gtk_notebook_new(); gtk_container_add(GTK_CONTAINER(my_data_p->window_p), notebook_p); grid0_p = gtk_grid_new(); gtk_notebook_append_page(GTK_NOTEBOOK(notebook_p), grid0_p, gtk_label_new("First Tab")); grid1_p = gtk_grid_new(); gtk_grid_attach(GTK_GRID(grid0_p), grid1_p, 2, 2, 2, 50); frame_p = gtk_frame_new("Rectangle"); gtk_frame_set_shadow_type(GTK_FRAME(frame_p), GTK_SHADOW_NONE); frame0_p = gtk_frame_new(NULL); scrolled_window_p = gtk_scrolled_window_new(NULL, NULL); my_data_p->hadjust_p = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW (scrolled_window_p)); my_data_p->vadjust_p = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW (scrolled_window_p)); drawing_area_p = gtk_drawing_area_new(); gtk_widget_set_size_request(scrolled_window_p, 300, 300); g_signal_connect(drawing_area_p, "configure-event", G_CALLBACK(configure_it), g_data_p); g_signal_connect(drawing_area_p, "draw", G_CALLBACK(draw_it), g_data_p); g_signal_connect(drawing_area_p, "scroll-event", G_CALLBACK(zoom_it), g_data_p); gtk_widget_set_events(drawing_area_p, gtk_widget_get_events(drawing_area_p) | GDK_SCROLL_MASK); my_data_p->drawing_area_p = drawing_area_p; gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window_p), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(scrolled_window_p), drawing_area_p); gtk_container_add(GTK_CONTAINER(frame_p), frame0_p); gtk_container_add(GTK_CONTAINER(frame0_p), scrolled_window_p); gtk_grid_attach(GTK_GRID(grid1_p), frame_p, 1, 0, 1, 2); my_data_p->rectangle_surface_p = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 3000, 3000); cr_p = cairo_create(my_data_p->rectangle_surface_p); cairo_set_line_width(cr_p, 50); cairo_rectangle(cr_p, 100, 100, 1375, 1375); cairo_rectangle(cr_p, 1525, 1525, 1375, 1375); cairo_set_source_rgb(cr_p, 0, 0, 0); cairo_stroke(cr_p); gtk_widget_show_all(my_data_p->window_p); } static gboolean zoom_it(GtkWidget *widget_p, GdkEvent *event_p, gpointer g_data_p) { m_data_struct *my_data_p; GdkEventScroll *this_event_p; gdouble new_x, new_y; int do_zoom = 0; my_data_p = (m_data_struct *)g_data_p; this_event_p = (GdkEventScroll *)event_p; if (this_event_p->direction == GDK_SCROLL_UP) { my_data_p->scaling_factor *= ZOOMING_STEP; gtk_adjustment_set_upper(my_data_p->hadjust_p, gtk_adjustment_get_upper(my_data_p->hadjust_p) * ZOOMING_STEP + 1); /* we need to calc the new upper to set value, +1 for inaccuracy */ gtk_adjustment_set_upper(my_data_p->vadjust_p, gtk_adjustment_get_upper(my_data_p->vadjust_p) * ZOOMING_STEP + 1); new_x = this_event_p->x * ZOOMING_STEP; new_y = this_event_p->y * ZOOMING_STEP; do_zoom = 1; } if (this_event_p->direction == GDK_SCROLL_DOWN) { double sf; sf = my_data_p->scaling_factor / ZOOMING_STEP; if (sf >= SCALING_FACTOR_INIT / (1 + (ZOOMING_STEP - 1) / 2)) /* zoom out max till level 0 but preventing inability not to zoom to level 0 due to inaccurancy */ { my_data_p->scaling_factor = sf; new_x = this_event_p->x / ZOOMING_STEP; new_y = this_event_p->y / ZOOMING_STEP; do_zoom = 1; } } if (do_zoom) { gtk_adjustment_set_value (my_data_p->hadjust_p, new_x + gtk_adjustment_get_value(my_data_p->hadjust_p) - this_event_p->x); gtk_adjustment_set_value (my_data_p->vadjust_p, new_y + gtk_adjustment_get_value(my_data_p->vadjust_p) - this_event_p->y); configure_it(widget_p, (GdkEventConfigure *)event_p, g_data_p); gtk_widget_queue_draw(widget_p); } return TRUE; } static gboolean configure_it(GtkWidget *widget_p, GdkEventConfigure *event_p, gpointer g_data_p) { cairo_t *cr_p; m_data_struct *my_data_p; my_data_p = (m_data_struct *)g_data_p; if (my_data_p->final_surface_p) cairo_surface_destroy(my_data_p->final_surface_p); my_data_p->final_surface_p = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 3000 * my_data_p->scaling_factor, 3000 * my_data_p->scaling_factor); gtk_widget_set_size_request(my_data_p->drawing_area_p, 3000 * my_data_p->scaling_factor, 3000 * my_data_p->scaling_factor); cr_p = cairo_create(my_data_p->final_surface_p); cairo_scale(cr_p, my_data_p->scaling_factor, my_data_p->scaling_factor); cairo_set_source_surface(cr_p, my_data_p->rectangle_surface_p, 0, 0); cairo_paint(cr_p); cairo_destroy(cr_p); return TRUE; } static gboolean draw_it(GtkWidget *widget_p, cairo_t *cr_p, gpointer g_data_p) { cairo_set_source_surface(cr_p, ((m_data_struct *)g_data_p)->final_surface_p, 0, 0); cairo_paint(cr_p); return FALSE; }
8004dc57e9f097cbcb2aba995603d6bafcca851edf2b2bdcacaaa5fd7de8c323
['aa540298329b4fcaae07f09141446f6d']
I'm trying to create a function which allows me to update a user's phone number in a Cognito User Pool. The code is in a NodeJS application, using the latest aws-sdk library. I have this function callback structure working for a number of other actions against the user pool, e.g. creating and listing users, updating MFA, etc. So I am confident there's nothing structurally wrong with the way I have laid the code out. But for this particular function, I am receiving an error that says AdminUpdateUserAttributes "is not a function". I've tried changing different attributes in case it's a phone number thing, but I got the same result. function cognitoUpdatePhone(username, phoneNumber, callback) { var params = { UserPoolId: '<my pool Id>', Username: username, UserAttributes: { phone_number: phoneNumber } }; var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); cognitoidentityserviceprovider.AdminUpdateUserAttributes(params, function (err, data) { if (err) { callback(err, false); } else { callback(null, true); } }); } I'm getting following response from the server. The stack trace indicates the source of the error is: aws-sdk/lib/state_machine.js message: 'cognitoidentityserviceprovider.AdminUpdateUserAttributes is not a function', code: 'TypeError',
88057a33064dcd3459738203d4b905a2a4cc74253c0c181b09a53b245347ffd8
['aa540298329b4fcaae07f09141446f6d']
I'm trying to use PIG to extract some XML from a field in a Hive table, rather than from an XML file (which is the assumption of most of the examples I have read). The XML comes from a table arranged as follows: ID, {XML_string} The XML string contains n. number of rows, always containing at least one from up to 10 attributes. We can assume that attribute #1 will always be present and will be unique. <row> <att1></att1> <att2></att2> ... </row> <row> <att1></att1> <att2></att2> ... </row> ... I want to transform this into a new table with each row in the XML string exploded out into a separate row in the new table, but I still want to include the ID from the existing table. ID, att1, att2, att3 == ==== ==== ==== 1 1 xxx xxx 1 2 xxx xxx 1 3 xxx xxx 2 1 xxx xxx I've approached this so far in PIG by using XPathAll. I've read a lot of advice that suggests avoiding Regex for XML parsing. REGISTER /home/piggybank-0.12.0.jar DEFINE XPathAll org.apache.pig.piggybank.evaluation.xml.XPathAll(); A = LOAD 'HiveTable' USING org.apache.hive.hcatalog.pig.HCatLoader(); B= FOREACH A GENERATE id, XPathAll(xml_string,'ROW/_ATT1') as att1; XPathAll(xml_string,'ROW/_ATT2') as att2; XPathAll(xml_string,'ROW/_ATT3') as att3; dump B; This results in the following output, assuming there are three row instances for item 1: (1 (Att1-i1,Att1-i2,Att1-i3),(Att2-i1,Att2-i2,Att2-i3),(Att3-i1,Att3-i2,Att3-i3)) All of the information appears to be there, I just can't seem to unlock the way to pull out the first element from each of the embedded tuples into a new row, then the second elements, and so on. In other words: (1, Att1-i1, Att2-i1, Att3-i1) (1, Att1-i2, Att2-i2, Att3-i2) (1, Att1-i3, Att2-i3, Att3-i3) I'm clinging to the hope this can be done using Hive + Pig without having to resort to Java, etc. I'd appreciate any insights. I'm not precious about the approach taken so far, so if I have gone the long way round, please tell me!
347e53f9c27cc1fa7b2ac64ca192dae1cf142336dae13f22729f130bb0b6d4dd
['aa6727b73a224fafb0aa287c9bf3bc7d']
Hello i am trying to create a kickass function to show alerts and run it's function. Buuut unfortunately Xcode and i am getting confused in here: buttonAction:Array<(Any) -> Any)> Expected '>' to complete generic argument list func callAlert(_ view: UIViewController, title:String, message:String, buttonName:Array<String>, buttonAction:Array<(Any) -> Any)>) { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) for index in 0..<buttonName.count{ alert.addAction(UIAlertAction(title: buttonName[index], style: .default, handler: { action in switch action.style{ case .default: print("default") buttonAction() case .cancel: print("cancel") case .destructive: print("destructive") }}))} view.present(alert, animated: true, completion: nil) } How do i call function? Please check below: callAlert(self, title: "Donate type", message: "Thanks for your support!", buttonName: ["Buy me a coffee!","Something"] )
8212371717ac93e59f5b4d4d9c2085e89b9a7c662042073b1fd1c5f60e34d5cc
['aa6727b73a224fafb0aa287c9bf3bc7d']
Well i changed the whole func and fixed it. func URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL location: NSURL) { statusLabel.text = "Download finished" print(downloadTask.response!.suggestedFilename!) let documentsUrl = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).first! as NSURL // your destination file url let destinationUrl = documentsUrl.URLByAppendingPathComponent(String(downloadTask.response!.suggestedFilename!)) print(destinationUrl) if NSFileManager().fileExistsAtPath(destinationUrl.path!) { print("The file already exists at path") } else { let data = NSData(contentsOfURL: (downloadTask.response!.URL)!) if data!.writeToURL(destinationUrl, atomically: true) { print("file saved") } else { print("error saving file") } } let filePath = String(destinationUrl.path!) var fileSize : UInt64 = 0 do { let attr : NSDictionary? = try NSFileManager().attributesOfItemAtPath(filePath) if let _attr = attr { fileSize = _attr.fileSize(); print(fileSize) self.statusLabel.text = String(fileSize) self.performSegueWithIdentifier("video", sender: self) } } catch { print("Error: \(error)") } resetView() }
56184298ab889984f580120435189c779a53fab83916d4a1ba32184d1f9d11ee
['aa7a060e1f574dc6bc074ab0423ad04c']
i'm setting up a project, and using ui-router. requirement is to have url which keep on appending eg: #/home/contacts. In order to achieve that, i have to use the nested states. eg: home and home.contacts, where home state will have in template which will get populate. But i want to have a single ui-view at root level, index.html, which will get templates when i will hit on url, eg, home or home/contacts. Is it possible to get this behaviour with ui-router? in nutshell, having nested behavior[not nested, i want appending url] with single ui-view at index.html. Note
c40ebb220989b7a81053b926c6fa3114adba4dcaa5be09588ee786d50ca3cc53
['aa7a060e1f574dc6bc074ab0423ad04c']
i have recently started a project and using webpack as build tool. angular.module('app') .controller('appController', require('./src/appController')); and my appcontroller.js looks like 'use strict'; var appController = function($scope){ $scope.name = 'hello'; }; appController.$inject(['$scope']); module.exports = appController; bundel is being formed at desired location, problem is when i use the function.$inject for dependency injection, as i want my code to get uglify, i gets browser error when i runs my app appController.$inject is not a function This is first time i'm experiencing the error as i'm using webpack?
9b61ea70b1970a1d39f1adc67b07a2a63ad7be7e08551177f5f4e1fa03fb22ab
['aa86e6b0eca1415eaaaa986e852363f4']
I always convert the raw data to top-of-atmosphere reflectance first, and then derive the index. I do this to address issues of variations of earth-sun geometry during the year, and also atmospheric path length. If this is done, then the index should range from -1 to +1, which would assume a theoretically perfect response of vegetation, and water, respectively. You should be able to find the procedure somewhere on the Lands at website. Good luck! <PERSON>, Ph.D., GISP CSU-Fresno
00da645fcbb53028d863ba644c2deb045c8412d75e1ff37aa3855cf4f38c06f7
['aa86e6b0eca1415eaaaa986e852363f4']
We tried using Microsoft JDBC Driver 2.0 with SQL Server 2005. The problem we were running into was - when calling a stored procedure, the driver was generating the following sql statements - declare @P1 int set @P1=1 exec sp_prepexec @P1 output, N'@P0 int', N'EXEC getEmployeeManagers @P0', 50 select @P1 So stored procedures run in the sp_prepexec statements. And later when you close the statement, the sp_unprepare gets called. This seems to be the default behavior of the MS driver. The problem with this is, the overhead to generate a prepared statement and then to close it has performance impact. Why can't the driver just do this - exec getEmployeeManagers @P0=50 We are now using the jTDS driver and it seems to be performing great.
fd0cd6d796041908941197e17ac1dc02a5496beddf15de8bb08e59ab90861f4b
['aa881db25af14928a63781d90b15cb51']
I'm writing some small Delphi script for Altium Designer that create an HTML report based on the PCB file. Which API command should I use to open the HTML file created before from that script? For now, I can only display the TEXT file by using: "Document := Client.OpenDocument('Text', FileName);" Below, I attached my script. Procedure DisplayReport; Var Board : IPCB_Board; Rpt : TStringList; FileName : TPCBString; Document : IServerDocument; Begin // Retrieve the current board Board := PCBServer.GetCurrentPCBBoard; If Board = Nil Then Exit; FileName := ChangeFileExt(Board.FileName,'.html'); Rpt := TStringList.Create; Rpt.Add('<h1>html header</h1>'); Rpt.Add('<table border="1">'); Rpt.Add('<tr>'); Rpt.Add('<tr style="background-color: yellow; ">'); Rpt.Add('<th>#</th>'); Rpt.Add('<th>RefDes</th>'); Rpt.Add('<th>Layer</th>'); Rpt.Add('<th>Footprint</th>'); Rpt.Add('</tr>'); Rpt.Add('<tr>'); Rpt.Add('<th>1</th>'); Rpt.Add('<th>R1</th>'); Rpt.Add('<th>TOP</th>'); Rpt.Add('<th>SMD_0603</th>'); Rpt.Add('</tr>'); Rpt.Add('<tr>'); Rpt.Add('<th>1</th>'); Rpt.Add('<th>R2</th>'); Rpt.Add('<th>TOP</th>'); Rpt.Add('<th>SMD_0603</th>'); Rpt.Add('</tr>'); Rpt.Add('<tr>'); Rpt.Add('<th>1</th>'); Rpt.Add('<th>R3</th>'); Rpt.Add('<th>BOT</th>'); Rpt.Add('<th>SMD_0085</th>'); Rpt.Add('</tr>'); Rpt.Add('</table>'); Rpt.SaveToFile(Filename); Rpt.Free; //open TXT file //Document := Client.OpenDocument('Text', FileName); //try to open HTML file Document := Client.OpenDocument(Client.GetDocumentKindFromDocumentPath(Filename), Filename); If Document <> Nil Then Client.ShowDocument(Document); End;
c08f9af362ad229beeab520a08aea9532e03102279d8ffcd4b12fca32dcf450f
['aa881db25af14928a63781d90b15cb51']
These are 100 altogether and they are the same patients before and after antibiotics- just different time intervals for each: eg patient A was not on antibiotics for 2 years and then took them for 5 years while patient B was not on antibiotics for 7 years and then took them for 1 year.
905480d8bfda1c10d62f8a4dc4917b06567f2d83ec901e20e182c650402b5c83
['aa8f66598c5d4719adf641ce79236503']
try kompozer it is a good tool for web designing it is easy to use. it is available on ubuntu software center search for it and install it. it is free and open source. another option is if you want to create only web pages: libre office writer it is very powerful and you can export your page to html pdf and other formats. libre ofice wirtter comes pr installed try them.
979cbd4738d01515208e9f38a8d549436b3bb7927be3f5d0918ee6bdf60c54c8
['aa8f66598c5d4719adf641ce79236503']
I don't know if initial memory footprint or a footprint of a Hello World application is important. A difference might be due to the number and sizes of the libraries that are loaded by the JVM / CLR. There can also be an amount of memory that is preallocated for garbage collection pools. Every application that I know off, uses a lot more then Hello World functionality. That will load and free memory thousands of times throughout the execution of the application. If you are interested in Memory Utilization differences of JVM vs CLR, here are a couple of links with good information http://benpryor.com/blog/2006/05/04/jvm-vs-clr-memory-allocation/ Memory Management Case study (JVM & CLR) Memory Management Case study is in Power Point. A very interesting presentation.
2a157b7658878d5c8f26b81a2df15744a4d0f288afa6dcedeb1d6d72c8aa9e02
['aa96a4316d604db683ffda7947ec3d34']
This looks to me a like a classic situation where getting a large sheet of squared paper plus fine-point pen or pencil, and plotting out the vectors will help. Start with the one you have, then draw in some others parallel to that vector at various locations, making them 27 times longer (having chosen fine-squared paper will help here!), and check their co-ordinates. You should soon start to get a feel of the whole idea after a few minutes of doing this.
8f11d2852d019b607d995c1a78d70317721ea00f5e646190963547a5ef3d2066
['aa96a4316d604db683ffda7947ec3d34']
3n+1 obviously cannot take us onto an even number divisible by 3, so what the 3(16), 6(15), 9(14) etc part of the list suggests to me is that these numbers can only feature in sequences at the beginning section of the sequence (eg 12 halves to 6 halves to 3 then goes by 3n+1 to 10 then halving to 5 etc....). My guess - that's all it is - is that when you count all the sequences starting with a given multiple of 3 and take into account double-counting you get this ranking. Obviously the larger the multiple of 3, the fewer sequences will involve it, and there is clearly something going on with odd multiples of 3, and the instances of double or quadruple that multiple. For example if 16 sequences start with or involve a 3, it doesn't seem odd that 15 sequences start with or involve a 6 (all 15 of them will immediately have 3 as the member right after 6, and there is only one sequence that can start with a 3, so that's the 16th in the list next to "3").
280d8428ecf1fc5913ebd575e052fe4fd53fdf8dd1e2ff46b72a4b52e44310ac
['aad72db721554980947050becb67313a']
After a ton of research and a lot of help from this thread: https://github.com/webpack/webpack/issues/215 I have discovered that there is no reliable way to do this, at least not what I had in mind. The solution I used in the end was in my entry file to use the following code: import $ from 'jquery'; $('body').addClass('css-loading-class-goes-here'); require.ensure(['../store.js', './../lib/routes.jsx'], function(require) { require(['../store.js','./../lib/routes.jsx']); }); You can add css, append content or whatever else you want to do at the start there, but this will only execute after alot of the 'native' javascript from webpack and friends has loaded (about 350kb in my case). Then the require.ensure enforces webpack to load all my app specific javascript in a seperate bundle after the fact, so my 'loader' is at lest active for half of the load process. This was the only solution that I could find in the end.
f2ac68dbd513e6c9399383eb546263e4c106d1685a7559bf321b6bc8075e2c02
['aad72db721554980947050becb67313a']
I am looking for a templating system (1 or 2 way binding, don't care) that is dom node based like angular and knockout. In other words they don't parse a string, but rather manipulate dom nodes and their contents when doing updates based on bound data. In addition to this I need to be able to parse these templates serverside with similar data being provided (pre-rendering, like you would for a search spider). I have searched and searched and explored many options but have yet to meet all of these criteria.
c11e324dc61cbd1de0ecf35c0700a81d749af491b248a06a894a4b030a98a25d
['aad9522fc73543d19631dfa23209c0b1']
Так правильно будет? if (file_exists("traffic.txt")) { $fp = fopen("traffic.txt", "w"); if (flock($fp, LOCK_EX)) { $get_traffic = fread($fp); $new_traffic = $get_traffic + 1; fwrite($fp, $new_traffic); fflush($fp); flock($fp, LOCK_UN); } else { header("location: /go.php"); } fclose($fp); } else { $fp = fopen("traffic.txt", "w+"); if (flock($fp, LOCK_EX)) { fwrite($fp, "1"); fflush($fp); flock($fp, LOCK_UN); } else { header("location: /go.php"); } fclose($fp); }
2add105e9eba495982dbcd65b67cbeb988b2a2934ad8192d0f3fdaab3d886cd8
['aad9522fc73543d19631dfa23209c0b1']
Доброго времени суток! Скажу сразу, я новичок и проблема несложная, но я хочу найти короткое, простое, надёжное решение. Знаю, похожих тем много, но прошу на пальцах объяснить мне конкретный пример. Вот у меня скрипт go.php на который шлю траффик, он должен сделать кое-какие проверки и если нужно, то открыть файл или создать его, если нет, считать содержимое, добавить переход юзера, и передиректить на index.php. Весь код приводить не буду ибо проблема с записью (при быстром сливе трафа (около 10 запросов в сек.) файл обнуляется. if (file_exists("traffic.txt")) { $get_traffic = file_get_contents("traffic.txt"); $new_traffic = $get_traffic + 1; // Добавляем ещё 1 переход file_put_contents("traffic.txt", $new_traffic, LOCK_EX); // Записываем строку (новое значение переходов) в файл с блокировкой доступа } else { file_put_contents("traffic.txt", "1", LOCK_EX); // Записываем строку (первый переход) в файл с блокировкой доступа } Это короче чем fopen, flock, fwrite, fclose. Но, LOCK_EX не работает, что не так, что добавить сюда или как надо. Только хотелось бы самый короткий правильный вариант, но, чтобы без косяков.
67c6915bd8fa71ee482478b28f98f387aacc81593fd2fee65c3e04264135db28
['aada0403073d4bf8bf04164c47182a35']
Thanks, I have formatted the output, so it's easier to read now. I'm not quite understand your answer. if I'm using"du -hsc dir_name" I should get the total size of it including it's sub files and directories is this what should I expect or I missing something?
3e04261e47d5c378829d0cecee6b47ea1e1e7957e6138b3293ab6cd5a313500c
['aada0403073d4bf8bf04164c47182a35']
I have Ubuntu 17.10 and see a question mark in place of wireless symbol in the top main bar. I can't connect to the Internet, however, I can connect to my router. Internet connection on my Windows notebook works fine. I've tried: sudo service network-manager restart sudo rfkill unblock all nslookup www.google.com returns "connection timed out; no servers could be reached" Here's lshw: sudo lshw -class network *-network description: Ethernet interface product: 82579LM Gigabit Network Connection vendor: Intel Corporation physical id: 19 bus info: pci@0000:00:19.0 logical name: enp0s25 version: 04 serial: 3c:97:0e:c1:3b:29 capacity: 1Gbit/s width: 32 bits clock: 33MHz capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-3 latency=0 link=no multicast=yes port=twisted pair resources: irq:31 memory:f2500000-f251ffff memory:f253b000-f253bfff ioport:6080(size=32) *-network description: Wireless interface product: Centrino Advanced-N 6205 [Taylor Peak] vendor: Intel Corporation physical id: 0 bus info: pci@0000:03:00.0 logical name: wlp3s0 version: 34 serial: a4:4e:31:48:ff:18 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=4.13.0-21-generic firmware=18.168.6.1 ip=<IP_ADDRESS><IP_ADDRESS> ip=<PHONE_NUMBER> latency=0 link=yes multicast=yes wireless=IEEE 802.11 resources: irq:32 memory:f1c00000-f1c01fff *-network DISABLED description: Ethernet interface physical id: 2 logical name: wwp0s20u4i6 serial: ae:99:db:a9:c7:96 capabilities: ethernet physical configuration: broadcast=yes driver=cdc_mbim driverversion=22-Aug-2005 firmware=CDC MBIM link=no multicast=yes I have installed VPN Windscribe and have tried: sudo windscribe logout Any help would be appreciated.
a4add4fe0e4bce8c36551c8bfb4a08f3a5cd62b1ebc44b415901b176646bc274
['aaf25bbef69d481ba1c1dd680eadbe22']
I have a website, which is created on asp.net and its URL is www.mydomain.com. I have another website which is created in PHP and hosted as www.new.mydomain.com. I have a menu(LOGIN) in my PHP website which will redirect to www.mydomain.com/login.aspx. When I change the document root, the website works fine, but the menu(LOGIN) returns with server error. The website is hosted in pesk. Is there any way to overcome this issue??
f61c8db3192906c68914346ba2aa18a5ff2b96e6228a214a7b4dc6ba9f31e5fe
['aaf25bbef69d481ba1c1dd680eadbe22']
I have a table in which users can store the data, the following is the code public function upload($name,$id) { $this->db->set('document',$name); $this->db->where('id',$id); $this->db->update('employee_details'); return true; } it works fine, but after this update, when I try to add additional data(here file) the old data got erased, and only the last uploaded data is there, how can I add the data without erase the old data?
b4f6a35f1355ef36159b7896642ac648b13aeac9be1a7a667275d0104c1af281
['aafcc023b48141958efe7d2385000eb5']
For some reason I am having a lot of trouble parsing date strings using Time<IP_ADDRESS>Piece. So this works: my $t = Time<IP_ADDRESS>Piece->strptime( 'Sunday, November 4, 2012 10:25:15 PM -0000' , "%A, %B %d, %Y %I:%M:%S %p %z" ); print $t; But this does not: my $temp_time = Time<IP_ADDRESS>Piece->strptime('7/23/2014 5:24:22 PM', "%-m/%-d/%Y %l:%M:%S %p"); print $temp_time; I have also used '%D %r' as the format string but that also does not work. Do any of you have insight as to why this might be? For reference , the hour is 1-12 (not 01-12) and the month is 1-12 (not 0-12). Thanks!
d6fa8bfcf46f1b4897779c4ff3f31f529ff4379bed15bb858f453ed361683b3f
['aafcc023b48141958efe7d2385000eb5']
I am currently trying to parse data from a CSV file, which in the first column has time stamps that look like this: 07/26/2014 00:23:09 I read the documentation for Time<IP_ADDRESS>Piece which I already use to parse other types of timestamps, and it seems that the format string for this time style should be "%D %T". However, when I try the line $temp_time = Time<IP_ADDRESS>Piece->strptime($fields[0], "%D %T"); Where $fields[0] is the string containing the timestamp, I get this type of warning when executing: garbage at end of string in strptime: 03:19:24 at /usr/local/lib64/perl5/Time/Piece.pm line 469, <$data> line 11933. Any pointers? I've also tried "%m/%y/%d %H:%M:%S" and that does not seem to work. Thanks!
32bf880fadabf1605f99b5c2acb3c37398d067964b5041627000db9d465cf1d2
['ab04fed13fb5436c9aff3867ced521d7']
<PERSON> - I didnt see the test, this is just part of my materials for the upcoming test so I am trying to learn how to change , to . I think that in my school it will be the same language preset as in my computer. Anyway is there is no posibility to change it through custom formatting, is there any other way how to change , to . ?
c792c50aa4185286dba9d0b796a7097ae85c0187560fd5cfdb94b8802ff892c1
['ab04fed13fb5436c9aff3867ced521d7']
<PERSON> is of course correct that the VS shell can be installed for free and then you just install the free F#. And he's correct again that to get both C# Express and VB Express on one machine is two separate installs. So for the stack-overflow types, really there is no need for F# Express. But consider a high-school, community-college or university setting. It's easier for the instructor, and easier for all the students to visit one site (the future 2010 Express edition site) and click on install F# Express. One URL for the instructors to document in class handouts, one place to go per student, then one install operation per student. And no instructor or student has to worry "Should I install integrated mode VS shell or isolated mode VS shell?" Again, there's no issue here for stack-overflow people. And it won't be an issue in the classrooms until instructors want to put F# into their classrooms. But there is a bit of chicken/egg here. If an F# Express edition exists before there is much demand in the classrooms, that removes a hurdle, which means classroom demand could take off sooner. Maybe a lot sooner.