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
91c5dc0f911afb0412e03e6b5e994cb2733fae6b6e1a607d520c3b4f2fd3e599
['c22057d486c34ab79cafea9d24e8de5a']
I am attempting to download pyspread. The homepage lists a set of dependencies that need downloading which I do using conda. All this is fine, but when I try to run pyspread I receive the following error message: > Traceback (most recent call last): > File "/usr/bin/pyspread", line 191, in OnInit > from src.gui._main_window import MainWindow File "/usr/share/pyspread/src/gui/_main_window.py", line 54, in <module> > from src.gui._toolbars import MainToolbar, MacroToolbar, FindToolbar File "/usr/share/pyspread/src/gui/_toolbars.py", line > 51, in <module> > from _gui_interfaces import ModalDialogInterfaceMixin File "/usr/share/pyspread/src/gui/_gui_interfaces.py", line 52, in <module> > from _dialogs import DimensionsEntryDialog, AboutDialog File "/usr/share/pyspread/src/gui/_dialogs.py", line 61, in <module> > from src.gui._widgets import PythonSTC File "/usr/share/pyspread/src/gui/_widgets.py", line 56, in <module> > import wx.combo ImportError: No module named combo OnInit returned false, exiting... It seems that I don't have the wx.combo module installed. I have tried reinstalling wxPython and nothing has changed. I can find the combo.py file if I type $ ls /usr/lib/python2.7/dist-packages/wx-3.0-gtk3/wx but I'm not sure what that means. I am very new to Linux and don't yet have the background to unpick this. Thank you.
a187a3686cd58a7d2475aa4a782ab8ef900c40aaa6cf46dc0fe7fe040323ed7d
['c22057d486c34ab79cafea9d24e8de5a']
I create a list in python using multiplication and a second more explicitly. I check that they are equal and then attempt to alter the same element in each. This alteration acts differently for each one. The code: list1 = [[0]*2]*2 list2 = [[0, 0], [0, 0]] print(list1 == list2) list1[0][0] = 3 list2[0][0] = 3 print(list1) print(list2) prints out: True [[3, 0], [3, 0]] [[3, 0], [0, 0]] What is going on? Why is a multiply-initiated list acting differently?
73e01a92dd93b1fd988e4871022d4a7f8448eaf50b2542c41d29c1cee9cee4ab
['c220bd152be545dc805be3dc99baeaed']
Welcome to Math.SE! Your question is phrased as an isolated problem, without any further information or context. This does not match [many users' quality standards](http://goo.gl/mLWc8), so it may attract downvotes, or be put on hold. To prevent that, please [edit] the question. [This](http://goo.gl/PlJyVQ) will help you recognise and resolve the issues. Concretely: please provide context, and include your work and thoughts on the problem. These changes can help in formulating more appropriate answers.
1b352bfe5289fbf17f9a391cc68b3fe3a0873d63f841b32918e70248f457d8f6
['c220bd152be545dc805be3dc99baeaed']
Welcome to Math.SE! I have tried to improve the readability of your question by introducing [$\LaTeX$](https://math.meta.stackexchange.com/questions/5020/). It is possible that I unintentionally changed the meaning of your question. Please proofread the question to ensure this has not happened. For some basic information about writing mathematics at this site see, *e.g.*, [here](/help/notation), [here](//math.meta.stackexchange.com/q/5020), [here](//meta.stackexchange.com/a/70559) and [here](//math.meta.stackexchange.com/q/1773).
d3ed92bc25dbca4c39ec93633e552f6ea11c1200c57e39fd091fcac7e80f1ecd
['c224f8db06c5476c8648d0754bc2d979']
I need some help with a bash mathematical expression script. I need the expression below to be a negative 2 to the power of 63 but I have tried all sorts of combinations from "", '', (()) and even keeping the positive value but multiplying it by -1 but I can't seem to get the syntax right. Original expression: kw=`expr 2^63 | bc` gives me 9223372036854775808 (which is correct) but I need to get a -9223372036854775808. I want to be able to do a kw=expr -2^63 | bc to get a negative results but it's not as straight-forward as I'd hoped. Hence my numerous attempts of different permutations to the expression. Any help will be very appreciated.
4f404c17644babed734ab01a877f8ca435ff8c40746d047fc42fdeb1202a6b63
['c224f8db06c5476c8648d0754bc2d979']
I am running a query but I'm a little stuck on the concept of subqueries in HiveQL. I am new to Hive and I've done a lot of reading but I still can't get it to work. So I have a big table with the fields I'm interested in being created_date and size. So I basically wan to run an aggregation of the sum of sizes of files created in a particular year and group by distinct year. My current query: SELECT year(created_date), SUM(size) FROM <tablename> GROUP BY created_date 2001 2654567 2001 231818 2001 1978222 2002 7625332 2002 6272829 2003 2733792 This gives me a list of all the years in the table and the sums of each year as above but I have duplicates of the year and this is where I need to do a subquery to SELECT DISTINCT year and the sum the total size too. Any help will be superb please.
47f543923fa58641a139ed6759cac88bf1592dbe346164aa4cac74c88df88c52
['c22609b6c9e94f4d885c4f1958ef3991']
I have a nested json structure { "feed": { "3": { "id1": { "id": "activity-1", "created": 1469905513973, "verb": "added recipe 1" }, "id2": { "id": "activity-2", "created": 1470013085119, "verb": "added recipe 2" }, "id3": { "id": "activity-3", "created": 1472341861543, "verb": "added recipe 3" } } } } I want to select everything in /feed/3 and order by created. I have been unable to figure out the correct syntax. SELECT jsonb_path_query( '{ "feed": { "3": { "id1": { "id": "activity-1", "created": 1469905513973, "verb": "added recipe 1" }, "id2": { "id": "activity-2", "created": 1470013085119, "verb": "added recipe 2" }, "id3": { "id": "activity-3", "created": 1472341861543, "verb": "added recipe 3" } } } }', '$."feed"."3".*') order by "created" desc; this version gives me an ERROR: column "created" does not exist with no order by clause, the output looks like # SELECT jsonb_path_query('{ "feed": { "3": { "id1": { "id": "activity-1", "created": 1469905513973, "verb": "added recipe 1" }, "id2": { "id": "activity-2", "created": 1470013085119, "verb": "added recipe 2" }, "id3": { "id": "activity-3", "created": 1472341861543, "verb": "added recipe 3" } } } }', '$."feed"."3".*'); jsonb_path_query -------------------------------------------------------------------------- {"id": "activity-1", "verb": "added recipe 1", "created": 1469905513973} {"id": "activity-2", "verb": "added recipe 2", "created": 1470013085119} {"id": "activity-3", "verb": "added recipe 3", "created": 1472341861543} (3 rows) I'm pretty certain it is some side-effect of jsonb_path_query returning a set, but I don't know how to handle it. Thanks for the help!
707753307bd5a1a8c166e74b7c0ae9b50562cddcc0c13efe7d3d690154a1d556
['c22609b6c9e94f4d885c4f1958ef3991']
I installed the latest Xcode 11 release (11A420a) on Mojave 10.14.6 and now homebrew fails with Error: Xcode alone is not sufficient on Mojave. Install the Command Line Tools: xcode-select --install The command line tools are installed $ xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates Any idea how to get past this?
4bad2c5c55b371d73e5ce1f85e1a50d6b2aaf5dd76010ae437d9e7c75bdb9b88
['c22d3649dd17401a90ed12c3823167fc']
I have a requirement to call action A multiple times from action B in the same method call. Is there any way to achieve it? I can give some background. I have a product specific API that is internally implemented with struts and the action can accept only one id and one file object. However, I have a requirement to store the same file for multiple ids. So can I use a custom action class that can receive multiple ids and in a loop call the action class that comes with the product. Also, can I pass the form data to the next action class through an interceptor
29c8bba4c84e1e785b5f6d3ebcf6d55e2f7981bb5d1e050795a56fad05f29dfd
['c22d3649dd17401a90ed12c3823167fc']
We are using WSO2 API Manager as a gateway to route requests to backend. We have a requirement to verify user credentials and authorization by making a call to Oracle Identity Manager and Oracle Access Manager before making the call to the backend. I have read the external LDAP user store configuration. But my client's enterprise is using Oracle identity management for user and access management. How can this be done in WSO2 API manager.
d013f9e3d7a225b538857403c79aa1817f98badf4d4e6a8a6995ed9055ce3a63
['c24ea7d395b2466ab1116325ba9fd862']
I am new to gwt and I am trying to check if the dynamic string document id that i am retrieving will will fit on the gwt label or not. Now I am checking for the number of characters and if the number exceeds 15 I am appending ... after 12 characters and displaying the actual id in the tooltip. I need to know how do i achieve this without calculating the number of characters. Please help
2f0683a7f9cf01fc38ab8e5de0ba130ebf3b6a8ecd6c59e44a98c10f498be9f9
['c24ea7d395b2466ab1116325ba9fd862']
I have a project where I am using the GWT command pattern to implement the RPC. Here how i can integrate the Spring with GWT. Without Spring I am able to achieve the RPC. But here i need to use Spring Dependency Injection for GWT server side packages. I am unable to find suitable sample or links to implement that. Can anyone please provide the links and samples which has this requirement. Without command pattern, I am able to integrate spring with GWT by referring following links http://technophiliac.wordpress.com/2008/08/24/giving-gwt-a-spring-in-its-step/ https://docs.google.com/document/pub?id=1USHYx9cB3B1s1zM4dlkzEZ759D3lEfavn_dDewvBkaA Thanks, <PERSON>
fb936de1b11a5500cfe165cd85f1c480796fd1881b3e0f11642f9becd6241a82
['c251de6dd3314997b1374ce7bcaf5fbb']
I working on transfering files from smartphone to peripheral device over BLE. Sending data over BLE is slow (data transfer is being implemented using overwriting one 20 bytes long characterisc). Slow speed is not a problem, because the size of files is really small also (up to 1MB). In trivial tests everything works good. As long as I try to run file transfer automatically in a loop (e.g. leave it running over night jsut for test purposes), on device with Bluetooth standard 4.2 after short time Android is spamming following content into Logcat : 01-24 13:44:08.411 1002 2449 10116 D vendor.qti.bluetooth@1.0-uart_controller: ReportSocFailure 01-24 13:44:08.411 1002 2449 10116 D vendor.qti.bluetooth@1.0-uart_controller: ReportSocFailure send soc failure 01-24 13:44:08.411 1002 2449 10116 E vendor.qti.bluetooth@1.0-uart_controller: Error reading data from uart After seconds of spamming this output, following output is written to Logcat, signalising that Bluetooth is being stopped / restarted 1-24 13:44:08.428 1002 2449 2449 W vendor.qti.bluetooth@1.0-async_fd_watcher: StopThread: stopped the work thread 01-24 13:44:08.428 1002 2449 2449 D vendor.qti.bluetooth@1.0-uart_transport: userial clock off 01-24 13:44:38.527 1002 2449 2449 I vendor.qti.bluetooth@1.0-uart_transport: DeInitTransport: Transport is being closed! 01-24 13:44:38.528 1002 2449 2449 D vendor.qti.bluetooth@1.0-power_manager: SetPower: enable: 0 01-24 13:44:38.529 1002 2449 2449 D vendor.qti.bluetooth@1.0-power_manager: GetRfkillFd: rfkill_fd: 9 01-24 13:44:38.529 1002 2449 2449 D vendor.qti.bluetooth@1.0-power_manager: ControlRfkill: rfkill_fd: 9, enable: 0 01-24 13:44:38.637 1002 2449 2449 W vendor.qti.bluetooth@1.0-data_handler: controller Cleanup done 01-24 13:44:38.638 1002 2449 2449 I vendor.qti.bluetooth@1.0-data_handler: DataHandler:: joined Init thread 01-24 13:44:38.638 1002 2449 2449 E vendor.qti.bluetooth@1.0-wake_lock: Release wake lock not initialized/acquired 01-24 13:44:38.638 1002 2449 2449 D vendor.qti.bluetooth@1.0-wake_lock: CleanUp wakelock is destroyed 01-24 13:44:38.638 1002 2449 2449 W vendor.qti.bluetooth@1.0-bluetooth_hci: BluetoothHci<IP_ADDRESS><IP_ADDRESS> joined Init thread 01-24 13:44:38.638 1002 2449 2449 E vendor.qti.bluetooth@1.0-wake_lock: Release wake lock not initialized/acquired 01-24 13:44:38.638 1002 2449 2449 D vendor.qti.bluetooth@1.0-wake_lock: CleanUp wakelock is destroyed 01-24 13:44:38.638 1002 2449 2449 W vendor.qti.bluetooth@1.0-bluetooth_hci: BluetoothHci::close, finish cleanup 01-24 13:44:38.713 u0_a3 3430 3430 D BluetoothSap: Proxy object disconnected 01-24 13:44:38.715 1000 26585 26585 D A2dpProfile: Bluetooth service disconnected 01-24 13:44:38.716 1000 26585 26585 D BluetoothSap: Proxy object disconnected 01-24 13:44:38.718 1000 26585 26585 D SapProfile: Bluetooth service disconnected 01-24 13:44:38.719 1000 26585 26585 D BluetoothInputDevice: Proxy object disconnected 01-24 13:44:38.719 10137 28340 28340 D BluetoothInputDevice: Proxy object disconnected After these events, service that is used to write out data is restarted, my guess is that because bluetooth module on device is restarted also. On device with Bluetooth standard 4.0 everything runs OK, I could leave the constant file transfer running for a day and crash will not occur. Do you please have any ideas or suggestion why this happens ? For interaction with bluetooth adapter I use library RxBle https://github.com/Polidea/RxAndroidBle Thanks.
f0cea4244d6182461b4ae8ca29b068fc4161c724d1d673b61376ed1f5a2edbd5
['c251de6dd3314997b1374ce7bcaf5fbb']
FYI - I have found in issue tracking system of BLE Kotlin Coroutines library similar issue to one I have - my error message exactly matches to error messages reported here : Problem with file transfer over BLE on Android In the description of the given issue, it is stated that the issue occurred on device Samsung Galaxy A5, which was exactly the device I was using. So I have come to the conclusion that this issue is probably related to this specific device, as long as I can run FW updates continuously on multiple different phones without a problem. I have not investigated further. My solution for this is - when applying update for whatever reason fails(BT error, the battery runs out, the device will go out of BT range), everything will be reset and the update will try to run again. You just cannot predict if/how/when will different devices misbehave - the solution is not to try to patch all possible errors that can occur but give system abitity to recover from the error.
d11c5aa3bd0b07b583743f0c3a2974674d51ef6698e0611d2154f829796a13b2
['c253165713364d64818fa6af11b0ab5b']
I am creating an ADB2C user flow for a user sign up page. I want to capture given name, surname, job title and email address. Currently with those attributes selected, when I navigate to the page layout I see the following: When I try to edit the order of the attributes, and move the email address to the bottom and hit save, Azure displays a success message that my changes have been saved, however the email address attribute is moved back to the top of the list. I'd like to achieve this: Is this possible?
9492ea820b3cbf55f6543c20b731d2939e55d8ab5f5ec7e379d59a6d65a72cd8
['c253165713364d64818fa6af11b0ab5b']
In this method, I have added a parameter $blindcopy that I want to be able to bcc users when called. After testing this script without that parameter added, all is well. After adding this addition, I receive an error saying "Cannot validate the argument on parameter 'bcc'. The argument is null or empty" I have tried adding AllowEmptyString() attribute to the parameter but still no luck. Any help is much appreciated! cls $BccNull = "" function SendEmail([string]$BodyString,[string]$SubjectString,[string[]]$EmailRecipientsArray,[string]$FileAttachment=$null,[AllowEmptyString()][string]$BlindCopy) { $MethodName = "Send Email" # Send the HTML Based Email using the information from the tables I have gathered information in try { $user = "<EMAIL_ADDRESS>" $pass = ConvertTo-SecureString -String "bar" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential $user, $pass $SMTPServer = "some.mail.server" if([string]::IsNullOrEmpty($BodyString)) { $BodyString = " Body text was empty for user: $ErrorMessageUserName" } if([string]::IsNullOrEmpty($FileAttachment)) { Send-MailMessage -From "<EMAIL_ADDRESS>" -To "<EMAIL_ADDRESS>" -Subject $SubjectString -Bcc $BlindCopy -Body $BodyString -BodyAsHtml -Priority High -dno onSuccess, onFailure -SmtpServer $SMTPServer -Credential $cred } else { Send-MailMessage -From "<EMAIL_ADDRESS>" -To "<EMAIL_ADDRESS>" -Subject $SubjectString -Body $BodyString -BodyAsHtml -Attachments $FileAttachment -Priority High -dno onSuccess, onFailure -SmtpServer $SMTPServer -Credential $cred } } catch { Write-Host "An Exception has occurred:" -ForegroundColor Red Write-Host "Exception Type: $($_.Exception.GetType().FullName)" -ForegroundColor Red Write-Host "Exception Message: $($_.Exception.Message)" -ForegroundColor Red #$ErrorMessage = "Script Error: "+ $_.Exception.Message + "`n" + "Exception Type: $($_.Exception.GetType().FullName)" #$SubjectLine = "Script Error: " + $MethodName + " " + $ErrorMessageUserName #SendEmail -BodyString $ErrorMessage -SubjectString $SubjectLine -EmailRecipientsArray $EmailErrorAddress -FileAttachment $null $SuccessfulRun = $false #ReturnStatusError -CurrentStatus "Error" -ErrorMessage $_.Exception.Message } } SendEmail -BodyString "Test" -SubjectString "Test" -EmailRecipientArray "<EMAIL_ADDRESS><IP_ADDRESS>IsNullOrEmpty($BodyString)) { $BodyString = " Body text was empty for user: $ErrorMessageUserName" } if([string]<IP_ADDRESS>IsNullOrEmpty($FileAttachment)) { Send-MailMessage -From "foo@bar.org" -To "bar@foo.org" -Subject $SubjectString -Bcc $BlindCopy -Body $BodyString -BodyAsHtml -Priority High -dno onSuccess, onFailure -SmtpServer $SMTPServer -Credential $cred } else { Send-MailMessage -From "foo@bar.org" -To "bar@foo.org" -Subject $SubjectString -Body $BodyString -BodyAsHtml -Attachments $FileAttachment -Priority High -dno onSuccess, onFailure -SmtpServer $SMTPServer -Credential $cred } } catch { Write-Host "An Exception has occurred:" -ForegroundColor Red Write-Host "Exception Type: $($_.Exception.GetType().FullName)" -ForegroundColor Red Write-Host "Exception Message: $($_.Exception.Message)" -ForegroundColor Red #$ErrorMessage = "Script Error: "+ $_.Exception.Message + "`n" + "Exception Type: $($_.Exception.GetType().FullName)" #$SubjectLine = "Script Error: " + $MethodName + " " + $ErrorMessageUserName #SendEmail -BodyString $ErrorMessage -SubjectString $SubjectLine -EmailRecipientsArray $EmailErrorAddress -FileAttachment $null $SuccessfulRun = $false #ReturnStatusError -CurrentStatus "Error" -ErrorMessage $_.Exception.Message } } SendEmail -BodyString "Test" -SubjectString "Test" -EmailRecipientArray "foo@bar.org" -FileAttachment $null -BlindCopy $BccNull
bc534f7b63d03618d81432094cb3f9dcd30bcccda4d13f5d3c6469366c130c8e
['c253699e583149df8ea7957f77cbdd3d']
js I have a method to enable and disable print option which has element id printReport_AId, so the existence of element is dynamic based on selection. I have a code to get document.getElementById('printReport_AId') this returning null everytime , i guess we need something like windows onload or interval method , not sure how to implement in vue.js I have attached the code below <template> <div id = "intro" style = "text-align:center;"> <div class="printIconSection" v-for="report in reports" :key="report.property" > <div class="Icon" id="printReport_AId" v-if="isOverview"> <font-awesome-icon :icon="report.icon" @click="printWindow()"/> </div> </div> <div class="logo"v-bind:class="{ 'non-print-css' : noprint }"> </div> </div> </template> <script type = "text/javascript"> var vue_det = new Vue({ el: '#intro', data: { timestamp: '' }, created() { }, methods: { printWindow() { }, mounted() { // window.addEventListener('print', this.noprint); }, computed(){ noprint() { const printicon = document.getElementById('printReport_AId'); if (printicon != 'null') { return true; } return false; }, }, } } }); </script> <style> @media print { .non-print-css { display: none; } } </style> i just tried window.addEventListener that didnt worked for computed . I need to get the element id dynamically. whenever i enable the print element , the element id should not be null. similarly, whenever i dont enable the print element , the element id should be null
9bda4153f31d9637cc0908b2afe38a1c8788cffff7005f115acb97e6e76f4085
['c253699e583149df8ea7957f77cbdd3d']
hi i am working on code to print the page in my vue web application . so in that i need to print static header in every page , either using css or js.i have created a header div component and made its position as fixed , its getting printed in all page but the content of body is cutted off half. i need to print a logo , current time stamp in the header section i adding code structure <div class="header"> <div class="logo"> </div> <div class="time stamp"> </div> </div>
a723cb65b926b8dbd06d74c23ec7c867fcb92e156ff44d37c3ab8cd666f83e05
['c25682c47a7d474b8d7cc7722d865685']
My team is working on a project with Unity 5.1.1. We are using Parse to store data online. Working on the editor is fine. Building a project with Mono as scripting backend has no problem. But building with IL2CPP causes a problem. When Parse is initialised, there will be an error as below missingMethodException: Method not found: 'Default constructor not found...ctor() of Parse.PlatformHooks'. I did research and find out that normally this error would occur if the project has optimisation turned on, but it is off for my project I have lost 2 days trying to fix this problem but found no solution yet
d283830aaebda50742198eeb13e81c355db230f593b0e4ac9c00853e5e15dc06
['c25682c47a7d474b8d7cc7722d865685']
My app uploads a picture to the user's album through graph API (/me/photos) and then grabs that picture, makes it user profile picture by sending the user to http://www.facebook.com/photo.php?fbid=[PID]&makeprofile=1 It worked well, the user would be presented with the page that he could crop and save right away. However, just 2 days ago, the page was changed. The user will, instead, be presented with the picture in theatre mode (popup on black screen) and has to click a non-obvious link "Make Profile Picture" to crop and save. The question is, it is the url that was just changed, or it is a new policy of Facebook. If it is a policy, I would like to have the link that this matter was announced See the picture here, https://drive.google.com/open?id=0B0vWR6nY09_wRzhwU3VadG81TGM. It used to be like on the left but now it is the one on the right
e8a9aa905665b54919e9347e4b516c87eec167655bc63440da5e4c3590729241
['c2584849d1534847994e6e5d3ce6a2f0']
I am new to Ubuntu. I installed Ubuntu and I think I have jumbled up the partitions. I wanted to create 3 logical Disks of 250Gb where Ubuntu will be installed and two other disks for files and other stuff. But after installation I am able to see the disks as folders in root directory and unable to write anything to those folder, (wrong mount points maybe :( ). Here are the mount points I gave during installation: First Disk: mount point: \ Second Disk: mount Point: \drive1 Third Disk: mount point: \drive2 When I tried to reformat using gnome-disk-utility 3.10.0 I got these errors:
76c54a12d14e09169d03dbf8b3e6483f419604ab02b94684b4b11e5b4b834653
['c2584849d1534847994e6e5d3ce6a2f0']
I know that you are supposed to "spell out" numbers under 100 in texts, such as: <PERSON> had seventy-five cows. Rather than: <PERSON> had 75 cows. But what about numbers under 100 which are not "full" numbers but decimals? <PERSON> had fifty point seven apples. That just looks weird. Surely, for such cases, you do: <PERSON> had 50.7 apples. ... right?
cb215769a662736a2d08ff5505b1a5c3b2035dd7fa2bee9398bc7bf4477ea01a
['c261c0cb01f741d9a892eab6e5c4fd5f']
I have a python script that basically goes on a page and automatically submits fields for me. But there are some cases that I might have to interfere and do some manual changes but I don't want to make the program sleep() for let's say 5mins in case the user has to interfere because in case there is no need for the user to interfere he/she will just stand there and wait for 5 mins :/ So basically what I want is for selenium to wait for the user to press a button with an XPATH of lets say XPATH1 before it proceeds with the rest of the code, I could also do the same with a Key combination, what I mean by that is when the user checks that everything is ok he could press ENTER and that would trigger selenium to continue # Pseudo code waitForUsr= WebDriverWait.until(User_click_Button_with_XPATH("XPATH")) waitForUsr= WebDriverWait.until(Keys.ENTER_is_pressed) Thank you for your time! I hope you can help me out.
e82b3148f314c2e95258af5f651c745298ed79345d5d15f6d45757a80331dbff
['c261c0cb01f741d9a892eab6e5c4fd5f']
Lets assume I have this code private void Exitbtn_Click(object sender, EventArgs e) { Application.Exit(); } And I want to call this function from another part of my code and not only from the click of the user code... { ...do something... Exitbtn_Click() } I have tried Exitbtn.Click +=new EventHandler(Exitbtn_Click); but it doesn't work i believe it is because of the word new but I am not sure, I am new to C#
87c27f6f39af54efd3ad0b8308b182a7ce4db9efc426ec288133db8fe3643a88
['c2627c1228ca45348beb14f8746270a8']
I wanted to find out if its possible to send an array of json objects to csjs from ssjs in a sessionScope variable. When I try to use sesionScope.get in my script block. It doesn't run? SSJS scriptsChartDojo.jss: function createChartData() { var resultArray = new Array(); resultArray = [ {y: 1978, text: "Blue Widget"}, {y: 1669, text: "Brown Widget"}, {y: 2017, text: "Green Widget"}, {y: 334, text: "Orange Widget"}, {y: 1051, text: "Pink Widget"}, {y: 1545, text: "Purple Widget"}, {y: 339, text: "Red Widget"}, {y: 1067, text: "Yellow Widget"}]; sessionScope.chartData = resultArray; } Xpage Source with CSJS in Scriptblock: <?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" dojoParseOnLoad="true" dojoTheme="true" xmlns:xe="http://www.ibm.com/xsp/coreex"> <xp:this.beforePageLoad><![CDATA[#{javascript:createChartData();}]]></xp:this.beforePageLoad> <xp:this.resources> <xp:dojoModule name="dojox.charting.Chart2D"></xp:dojoModule> <xp:script src="/scriptsChartDojo.jss" clientSide="false"></xp:script> </xp:this.resources> <xp:scriptBlock id="scriptBlock1"> <xp:this.value><![CDATA[makeCharts = function() { //Create a new 2D Chart var pieChart = new dojox.charting.Chart2D("#{id:panel1}"); alert(sessionScope.get("chartData")); // Does not alert anything. // Add the only/default plot for the pie chart pieChart.addPlot("default", {type: "Pie", radius: 150, fontColor: "black", labels: false}); // Add the data series pieChart.addSeries("Number of Orders", sessionScope.get("chartData")); // Causes blank screen to load //Render the chart! pieChart.render(); }; XSP.addOnLoad(makeCharts);]]></xp:this.value> </xp:scriptBlock> <xp:panel style="height:450px;width:450px" id="panel1"></xp:panel> </xp:view>
981064aa346c2131369910da080fec37e2c598d99b40550eb9e813f7fd6405b6
['c2627c1228ca45348beb14f8746270a8']
I have a repeat control that calls data from an sql table with javascript. The repeat has a column name with data from the table and another column with a check box in it. The check box is ticked to store the data from the repeat in a separate table. I want to clear all check boxes in the repeat when a button is clicked. How do I do that? Heres what I've tried. <?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex" xmlns:xc="http://www.ibm.com/xsp/custom"> <xp:this.resources> <xp:script src="/scriptsNewConflictRequest.jss" clientSide="false"></xp:script> </xp:this.resources> <xp:repeat id="repeat1" rows="30" var="rowData" value="#{javascript:getBusinessUnitsCR()}"> <xp:table style="width:99.0%"> <xp:tr> <xp:td style="width:50.0%"> <xp:label value="#{javascript:rowData.busUnit}" id="label4"></xp:label> </xp:td> <xp:td align="center" style="width:20%"> <xp:checkBox text="Yes" id="checkBU" checkedValue="Yes" uncheckedValue="No"> <xp:eventHandler event="onchange" submit="true" refreshMode="norefresh" id="eventHandler1"> <xp:this.action><![CDATA[#{javascript:saveOrDelBU();}]]</xp:this.action> </xp:eventHandler> </xp:checkBox> </xp:td> </xp:tr> </xp:table> </xp:repeat> <xp:button value="Clear Check Boxes" id="button3"> <xp:eventHandler event="onclick" submit="true" refreshMode="complete" id="eventHandler4"> <xp:this.action><![CDATA[#{javascript: //Method 1 getComponent("checkBU").setValue("No");}]]>//Did Not Work //Method 2 context.redirectToPage(context.getUrl().toString());//Does not help because the page is on a switch facet and it does not redirect back to this page. </xp:this.action> </xp:eventHandler> </xp:button> </xp:view> Tried the two methods listed above. Not sure what else to try.
dc09e93f2fc435e54c838adf49aa76ba8d5dbbd1f55a3a77dd565c1102ec233d
['c26537d269fe4abca3a15b200b772cae']
I'm currently trying to make Jenkins job that runs if there's difference between the version number between 2 runs. What I'm currently thinking on doing is by running curl on my webapp endpoint to get the webapp version. I'm looking to store this webapp version information onto jenkinsfile or any file. The next time the jenkins job runs, it will do curl again to my webapp endpoint and compare the version between the current curl output and the saved version information from last run. However, as I'm still kind of new to Jenkins, i have no idea on where to start to create the file to store the information i want, anyone have some recommendation or advice for me on how to solve this problem ? Thanks
6fbb0b6301182767ee31bf12b6d080d165335d16c5de76614cb24fbea82217d6
['c26537d269fe4abca3a15b200b772cae']
As the title says, are there anyway to run nightwatch under different IP ? I want to run test cases for my web that test if user could login from certain IP. Are the any NW settings/configuration file that i can edit to achieve this ? Because I also want to run this script on Jenkins as well
c5ae10c267ea1b3dd9bf29e907ae5e7cb55b63530c6ee8e626816bda3115543c
['c27ab0fbc7ee4497945ff2b77e409bd0']
I just tries to share string with link to my app. Here is my code: public static void shareApp(Activity activity){ ShareCompat.IntentBuilder builder = ShareCompat.IntentBuilder.from(activity); builder.setText("some link") .setType("text/html"); activity.startActivity(builder.createChooserIntent()); } Usually it works good. But sometime I gets errors with next stack trace: 0 java.lang.OutOfMemoryError: bitmap size exceeds VM budget 1 at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2 at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460) 3 at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336) 4 at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697) 5 at android.content.res.Resources.loadDrawable(Resources.java:1709) 6 at android.content.res.Resources.getDrawable(Resources.java:581) 7 at android.app.ContextImpl$ApplicationPackageManager.getDrawable(ContextImpl.java:2201) 8 at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:140) 9 at android.content.pm.ComponentInfo.loadDefaultIcon(ComponentInfo.java:154) 10 at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:145) 11 at android.content.pm.ResolveInfo.loadIcon(ResolveInfo.java:181) 12 at com.android.internal.app.ResolverActivity$ResolveListAdapter.bindView(ResolverActivity.java:431) 13 at com.android.internal.app.ResolverActivity$ResolveListAdapter.getView(ResolverActivity.java:415) 14 at android.widget.AbsListView.obtainView(AbsListView.java:1430) 15 at android.widget.ListView.measureHeightOfChildren(ListView.java:1216) 16 at android.widget.ListView.onMeasure(ListView.java:1127) or with: 0 java.lang.OutOfMemoryError: bitmap size exceeds VM budget 1 at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2 at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460) 3 at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336) 4 at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697) 5 at android.content.res.Resources.loadDrawable(Resources.java:1709) 6 at android.content.res.Resources.getDrawable(Resources.java:581) 7 at android.widget.AbsListView.setOverScrollMode(AbsListView.java:655) 8 at android.view.View.<init>(View.java:1879) 9 at android.view.View.<init>(View.java:1921) 10 at android.view.ViewGroup.<init>(ViewGroup.java:292) 11 at android.widget.AdapterView.<init>(AdapterView.java:228) 12 at android.widget.AbsListView.<init>(AbsListView.java:592) 13 at android.widget.ListView.<init>(ListView.java:163) 14 at android.widget.ListView.<init>(ListView.java:159) 15 at com.android.internal.app.AlertController$RecycleListView.<init>(AlertController.java:673) This bug was reproduced on HTC Nexus One with Android 2.3.6 and I think that problem in this device - it's old and slowly. But can I create some wrapper for startActivity() method or other workaround to stopped this crashes?
8b73b3a58d40618a8c3d178ff6139741b6f78a5bd8bdd8b6a3189ab82db28f61
['c27ab0fbc7ee4497945ff2b77e409bd0']
Unfortunatelly, I haven't found any documentation on this point, so maybe I do something wrong. I use mupdf sample for android and I have slightly modified the source code of MuPDFActivity this way: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAlertBuilder = new AlertDialog.Builder(this); if (core == null) { core = (MuPDFCore)getLastNonConfigurationInstance(); if (savedInstanceState != null && savedInstanceState.containsKey("FileName")) { mFileName = savedInstanceState.getString("FileName"); } } if (core == null) { Intent intent = getIntent(); byte buffer[] = null; if (Intent.ACTION_VIEW.equals(intent.getAction())) { Uri uri = intent.getData(); try { InputStream inputStream = new FileInputStream(new File(uri.toString())); int len = inputStream.available(); buffer = new byte[len]; inputStream.read(buffer, 0, len); inputStream.close(); } catch (Exception e) { Log.e(TAG, e.getMessage()); } if (buffer != null) { core = openBuffer(buffer); } else { core = openFile(Uri.decode(uri.getEncodedPath())); } SearchTaskResult.set(null); } The activity's openBuffer() method hasn't been changed: private MuPDFCore openBuffer(byte buffer[]) { System.out.println("Trying to open byte buffer"); try { core = new MuPDFCore(this, buffer); // New file: drop the old outline data OutlineActivityData.set(null); } catch (Exception e) { System.out.println(e); return null; } return core; } After I try to open any pdf, app shows alert with message "Cannot open document". This is logs: 03-21 10:43:14.754 3601-3601/com.artifex.mupdfdemo.debug E/libmupdf﹕ Opening document... 03-21 10:43:14.754 3601-3601/com.artifex.mupdfdemo.debug E/libmupdf﹕ error: No document handlers registered 03-21 10:43:14.754 3601-3601/com.artifex.mupdfdemo.debug E/libmupdf﹕ error: Cannot open memory document 03-21 10:43:14.754 3601-3601/com.artifex.mupdfdemo.debug E/libmupdf﹕ Failed: Cannot open memory document So, whether there is any way to open pdf file as a byte array and what is this way?
e4a15fab634dbe5705927ce7724f9c5a8252e5ea2cf6609d57ad11bab5fd3a52
['c283274afc4f402989bef3ea3d6fa462']
We figured different git-secret versions might be the cause of this. When inspecting the kbx file with kbxutils (https://www.gnupg.org/documentation/manuals/gnupg/kbxutil.html) we could see there were only changes to the header - an empty blob was removed. The keys inside were unchanged. So commiting should be okay and not cause any conflict, but different git-secret versions by other teammates may cause the keyring to be changed again.
bbcf6596ade141961c39cc890456dd19d76e2a520331a73d3d771f1bb4e25c19
['c283274afc4f402989bef3ea3d6fa462']
I'm trying to understand the git-secret workflow. This was the scenario: Teammate added my gpg key via git-secret tell and re-encrypted the secret files + pushed them. I can reveal these files, reencrypt them via git-secret hide and see that after reencryption (hide) that other teammates should be able to access these files because they are listed in git-secret whoknows -> works nicely! I noticed that just after executing git-secret reveal the pubring.kbx changed. I dont understand why this would be the case. Am i not just decrypting files? Why would revealing information cause changes to the keyring? Do i need to commit these changes?
b05a19fc44eff3195cf4f668fb821e4216e26e0485b27639ca9022a19123db17
['c29329fa392946249ac2490790efe414']
I am working on a ebook reader app. The issue i am facing is with loading a Kannada ebook. I am loading xhtml files from document dir. to UIWebView. Now the problem is, If i give path to file like .../OPS/xhtml/ch1.xhtml Then the text is not displaying properly , but all images in book are displaying. If i give path to file like .../OPS/xhtml//ch1.xhtml Then the text is displaying properly , but images in book are not displaying. I am not able to figer out why this is happening and what is the solution.
7161bdd1636a4b43d682517851d9994c9f048a6d98a1dd576dd928894f8cfdd0
['c29329fa392946249ac2490790efe414']
I have added scrollview inside UITableViewCell, now i have to add Show More Info button inside the scrollview at the bottom . When user clicks on 'show more info' requests has to be sent to server and the parsed response has to be shown in scrollview, appending to the old data in cell/scrollview. I think i can use reload table view once i get response from server but this will scroll the scrollview to top. What is the best way to solve this problem ?
cd3a510c3e5e083f60f841091cc5d5352bd2724501d4def09ae3d396bd34e9b6
['c294f666124445faaa4e887dafa9748a']
Hi I believe it's not a dying GPU because we have same issue in all our MAC's. It started after Yosemite upgrade. https://www.dropbox.com/s/n04b4tmbbggkftd/wierdvideoproblem.mp4?dl=0 It may be Little Snitch. I disabled network traffic activity monitor, because glitch update pattern is like a data transfer pattern. I'll post updates.
34bd8b1b03691f65bf3daa7aab756b379ebb642a972b23dd77a3a38f47cfc120
['c294f666124445faaa4e887dafa9748a']
ante que nada soy un programador básico de PHP y MySQL. Me solicitaron que aplique esta autentificación en un sistema creado por mi y realmente no entiendo que debo hacer cuando llego al segundo paso. La autentificación es de “Mi Argentina” que la explicación breve se encuentra en esta url https://argob.github.io/mi-argentina/doc/plataformas.html Seguramente para mas de uno de ustedes esto es muy sencillo, pero a mi se me hizo lió cuando llego a la parte. “Luego del primer paso, se recibe un parámetro code que hay que intercambiarlo por un token de acceso mediante un extremo. La llamada debe ser de servidor a servidor, ya que involucra la clave secreta de la aplicación (la clave secreta de la aplicación no debe aparecer nunca en el código del cliente).” Yo logro que se logue y me envie el “code” y ahora no se que debo hacer para conseguir los datos del usuario que se logueo. Por mis básicos conocimiento, tampoco se que significa de servidor a servidor, un código php que no muestre nada en pantalla o hay que instalar algo al servidor? Muchas gracias por su tiempo. Saludos!
81021868a3249e069811c54f348cf7e4a3bb6175bfac66a3a3aefb980aa53acf
['c2950b3159114ea9bd1af54558c5dd15']
I am using express.js, mongoose, jquery and socket.io I am trying to pass the object "allFightScores" to the socket on clientside. Here is where I am requesting information from mongoose in my routes/index.js: var models = require('../models/index.js'); var passport = require('passport'); var crawl = require('../crawler.js'); var flash = require('connect-flash'); var express = require('express'); var app = express(); var server = require('http').createServer(app); var io = require('socket.io').listen(server); exports.submit_scores = function(req, res){ var scored_fight = new models.UserScore({ "f1": req.body.f1, "f2": req.body.f2, "f1_roundScores": req.body.f1_roundScores, "f2_roundScores": req.body.f2_roundScores, "f1_score": req.body.f1_score, "f2_score": req.body.f2_score, "user_email": req.body.user_email }); models.UserScore.find({ "f1": scored_fight.f1, "f2": scored_fight.f2, "f1_score": scored_fight.f1_score, "f2_score": scored_fight.f2_score, "user_email": scored_fight.user_email }, function(err, data){ if (data.length === 0){ scored_fight.save(function(err, user_fight){ if (err) { return "error"; } else { models.UserScore.find({"f1": user_fight.f1, "f2": user_fight.f2}, function(err, allFightScores){ console.log("from index-routes " +allFightScores); io.sockets.emit('show scores', allFightScores) }) } }) //put a callback on the user_scored_fight data, also emit that data with the average scores; res.json(scored_fight); } else if (data[0].f1 === scored_fight.f1 && data[0].f2 === scored_fight.f2 && data[0].user_email === scored_fight.user_email) { res.json(200); console.log("data already judged."); } }) } Here is where I am catching the data on my clientside (public/javascripts/script.js): jQuery(function($){ socket = io.connect(); var $group_f1_score = $('#gf1_score'); var $group_f2_score = $('#gf2_score'); socket.on('show scores', function(mongooseData){ console.log("mongooseData from scripts " + mongooseData) $group_f1_score.empty(); $group_f2_score.empty(); //sum fighter scores for all user submissions var f1_sumScore = 0; var f2_sumScore = 0; for (var i = 0; i < mongooseData.length; i++){ f1_sumScore += mongooseData[i].f1_score; f2_sumScore += mongooseData[i].f2_score; } //get the simple average var f1_avgScore = f1_sumScore/mongooseData.length; var f2_avgScore = f2_sumScore/mongooseData.length; $group_f1_score.append(f1_avgScore); $group_f2_score.append(f2_avgScore); }) }) I am not sure why the data is not emitting to my clientside and am out of ideas. Am I querying the data and passing it in the callback correctly?
69bfc39eb7ce39777505a89b799268f90bf6c92c106a27a611b9eb664ce8da8f
['c2950b3159114ea9bd1af54558c5dd15']
I'm near the end of Chapter 5 on Hartl's Tutorial. In the previous section (5.4), I have created a user signup page. Now I am required to check that I have created the user signup static page correctly by running rspec: $ bundle exec rspec spec/ and I get this notice: Pending: StaticPagesHelper add some examples to (or delete) /Users/kelvinyu/rails_projects/sample_app/spec/helpers/static_pages_helper_spec.rb # No reason given # ./spec/helpers/static_pages_helper_spec.rb:12 static_pages/help.html.erb sample # No reason given # ./spec/views/static_pages/help.html.erb_spec.rb:4 static_pages/home.html.erb add some examples to (or delete) /Users/kelvinyu/rails_projects/sample_app/spec/views/static_pages/home.html.erb_spec.rb # No reason given # ./spec/views/static_pages/home.html.erb_spec.rb:4 Finished in 0.28953 seconds 16 examples, 0 failures, 3 pending Randomized with seed 27698 Not sure what this "Pending" status really means and if I have an error. If so, what is the best way to fix this? Please let me know if more information is needed.
27b73ccc862804824356b49cbd86e5db1ba3327fcffeb5c133054bffe27350f1
['c2aff636712a474d90881d0e514c5b7a']
im making a swing application which will sign in to a server; were im using HttpURLConnection to submit my request and get my response. problem is when the httpRequest gets to the server the "Cookie: JSESSIONID" header is there, session id is there; but the request.getSession(false) will always return null. here is the code which i use to set the header on the client: connection.setRequestProperty("Cookie: JSESSIONID", client.getSessionId()); any help would be apprectiated
fcd4644158a555330928d2fdcb21dba60d3a4f0124f36e041ec2e19042a3ff08
['c2aff636712a474d90881d0e514c5b7a']
According to IBM XML-FW is there only for testing and debugging, what Im looking for is a way to let the Datapower do all the business with no backend server. so basically i need to configure a MPG to read from the database and send the result back to the client with no backend server to be involed. what is the practice to accomplish this without using XML FW loop-back?
ef545ab2988532df8130d5f068ed931f689d247365b9dcea1e6dd87d7d826cb3
['c2b7ad0ad9634bfc867eb73e676c4f8b']
Here's code that will perform a resize of the image based on the geometry (width) of the widest of two annotation text lines. This should help solve part of the challenges you have. The code: <?php // >> Q: Resize image to the width of a text box (2 lines) using Imagick in PHP // >> URL: https://stackoverflow.com/questions/62772906/resize-issue-dynamic-image-creation-on-the-base-of-user-input-imagick-php // // >> How to get geometry of an image using Imagick in PHP // >> > https://www.php.net/manual/en/imagick.getimagegeometry.php // // >> How to get dimensions of text using Imagick in PHP // >> > https://www.php.net/manual/en/imagick.queryfontmetrics.php /* Create some objects */ $customImage = new Imagick('test.png');//dynamic image $ciGeo=$customImage->getImageGeometry(); // >> $ciWidth=$ciGeo['width']; // >> $ciHeight=$ciGeo['height']; // >> $ciAspect=$ciWidth/$ciHeight; // >> > Aspect ratio (eg. 1=square) $image = new Imagick(); $draw = new ImagickDraw(); $pixel = new ImagickPixel( '#FFF' ); /* Black text */ $draw->setFillColor('#a28430'); /* Font properties */ $draw->setFont('Roboto-Black.ttf'); $draw->setFontSize( 30 ); // >> Get two annotation text lines $textLine1 = "First Line"; $textLine2 = "second line"; // >> Get text lines metrics to calculate geometry text box $metricsL1 = $image->queryFontMetrics($draw, $textLine1); $metricsL2 = $image->queryFontMetrics($draw, $textLine2); $textWidth = $metricsL1['textWidth']; if ($metricsL2['textWidth'] > $metricsL1['textWidth']) { $textWidth = $metricsL2['textWidth']; }; // >> Resize images based on text box width $diWidth = $textWidth + 20; // >> +20 = 2*10 padding $diHeight = ($textWidth + 20)*$ciAspect; // >> Height = width * aspect ratio $customImage->scaleImage($diWidth, $diHeight); // >> Scale // New image $image->newImage($diWidth, $diHeight, $pixel); // ++ // Create text $image->compositeImage($customImage,Imagick<IP_ADDRESS>COMPOSITE_DEFAULT, 0, 0); $image->annotateImage($draw, 10, 50, 0, $textLine1);// dynaimc text >> $image->annotateImage($draw, 10, 70, 0, $textLine2);// dynamic text >> // Give image a format $image->setImageFormat('png'); // Output the image with headers header('Content-type: image/png'); echo $image; ?> a sketch output
d5cd1fbc7f58816425a18e6d8aab3d4623c656094de579e73898632889464297
['c2b7ad0ad9634bfc867eb73e676c4f8b']
This should do it ... script.vbs Set xmlDoc = CreateObject("MSXML.DOMDocument") xmlDoc.Load "input.xml" Set xmlNodeName = xmlDoc.selectSingleNode("/FCIV/FILE_ENTRY/name") Set xmlNodeMD5 = xmlDoc.selectSingleNode("/FCIV/FILE_ENTRY/MD5") Set fso = CreateObject("Scripting.FileSystemObject") Set file = fso.OpenTextFile("output.txt", 2, True) file.WriteLine "* name: " & xmlNodeName.Text file.WriteLine "* MD5: " & xmlNodeMD5.Text input.xml <?xml version="1.0"?> <FCIV> <FILE_ENTRY> <name>e:\logs3\database1.txt</name> <MD5>0rxJSXF5tCO3pAk3IcSJBA==</MD5> </FILE_ENTRY> </FCIV> remark: XML is cAsE-sEnSiTiVe output.txt * name: e:\logs3\database1.txt * MD5: 0rxJSXF5tCO3pAk3IcSJBA==
7ede217544e30ad4dc41bb4c0ed29e44d06b140d6703b661d905eff9093ce09b
['c2b89eea3b7d4287a1ef85a5579c61ed']
It seems that your docker image is larger than the default disk limit. You can increase the disk limit when you push your docker image by specifying the parameter -k. E.g.: cf push -k 2G If you're using a manifest to specify the parameters please add the following code to your manifest.yml disk_quota: 2G
826125cb8a93413ace519665df9be90779a110b60ef7b23a5df6c94b6c47ba97
['c2b89eea3b7d4287a1ef85a5579c61ed']
You can access the service directly when using 'cf ssh' to your app. The complete process on how to access your service using 'cf ssh' is described in Swisscoms documentation: https://docs.developer.swisscom.com/devguide/deploy-apps/ssh-apps.html You're app should be able to handle connectivity issues by itself. Usually a simple retry keeps the app from crashing.
448866b06b0da89cdb667a5bc4fb0561dd4159e428b36926305a27aea2b7002b
['c2c8e3bbef43489287de31ae74c21830']
I have a PHP file that output some information within a JQuery TAB. PHP file $output2 .='<div class="demo">'; $output2 .='<div id="tabs">'; $output2 .='<ul>'; $output2 .='<li><a href="#tabs-1">Option 1</a></li>'; $output2 .='<li><a href="#tabs-2">Option 2</a></li>'; $output2 .='</ul>'; $output2 .='<div id="tabs-1">'; $output2 .='<p>1st text.</p>'; $output2 .='</div>'; $output2 .='<div id="tabs-2">'; $output2 .='<p>2nd text.</p>'; $output2 .='</div>'; $output2 .='</div>'; $output2 .='</div>'; HTML file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="themes/base/jquery.ui.all.css"> <script src="jquery-1.8.0.js"></script> <script src="ui/jquery.ui.core.js"></script> <script src="ui/jquery.ui.widget.js"></script> <script src="ui/jquery.ui.tabs.js"></script> <link rel="stylesheet" href="css/demos.css"> <script> $(function() { $( "#tabs" ).tabs(); }); </script> </head> <body> <?php echo $output2; ?> </body> </html> When I run the php everything works less the jquery function. If I run the script directly within a HTML file, runs perfectly
bab2329a174e7db6ea0f2f0367b418bd06d535d5c31559f29959a1456f7e734e
['c2c8e3bbef43489287de31ae74c21830']
I do have a routine that uses PHP, MySQL and JavaScript. There are two tables: tbl_category and tbl_subcategory just like this: tbl_category cat_id cat_name tbl_subcategory scat_id cat_parent_id cat_name They have some information inside like tbl_category: Pants Shoes t-Shirts tbl_subcategory: 1 Jeans 1 Heavy Duty 2 Boots 2 Sandals 3 Long Sleeves 3 Short Sleeves 3 Polo I put in the file head the link to the javascript library: <script type="text/javascript" src="jquery-1.8.2.min.js"></script> of course I download previously from the jquery website(newer version). I have now the script routine: <script type="text/javascript"> $(document).ready(function(){ $("select[name=cat_id").change(function(){ $("select[name=scat_id]").html('<option value="">Loading...</option>'); $.post("ajax_subcategory.php", {cat_id:$(this).val()}, function(valor){ $("select[name=scat_id]").html(valor); } ) }) }) Now I have the form, with the select field Category pre-loaded with data from the table tbl_category: <form name="form" method="post" action="" enctype="multipart/form-data"> <table width="100%" border="0" cellspacing="6" cellpadding="0"> <tr> <td align="right">Category:</td> <td><select name="cat_id" > <option value="0">Choose category</option> <?php $sql1 =mysql_query("SELECT * FROM tbl_category ORDER by cat_name")or die(mysql_error()); while($row = mysql_fetch_array($sql1)) { echo ("<option value=\"$row[cat_id]\"" . ($sql1 == $row["cat_name"] ? " selected" : "") . ">$row[cat_name]</option>"); } ?></select> </td> </tr> <tr> <td align="right">Sub-category:</td> <td><select name="scat_id" selected="selected" > <option value="0">Waiting category...</option> </select> </td> </tr> </table> <input type="submit" name="submit" value="Submit"/> </form> and then the php file called ajax_subcategory: <?php include "../connect_to_mysql.php"; $cat_id = $_POST['cat_id']; $sql1 =mysql_query("SELECT * FROM tbl_subcategory WHERE cat_parent_id='$cat_id' ORDER by cat_name")or die(mysql_error()); while($row = mysql_fetch_array($sql1)) { echo ("<option value=\"$row[scat_id]\"" . ($sql1 == $row["scat_name"] ? " selected" : "") . ">$row[scat_name]</option>"); } ?> Done! Everything looks perfect and beautiful. When I select the item in the first combo I can see the Javascript in action and the Loading... showing up but the the second ComboBox always is empty don't matter what item I select it shows up empty and become smaller(width). This is a good routine and I saw working in the web from another website. Can you guys help me out to find a solution? Thanks
d5526e649646e5658f351f450da2c76a09ecbab8f7daa76182f347f363fd7e05
['c2d4e49fa27744149c6bf7fc2f953e4f']
I have 10 sounds, and it would be easier for me to put them into an array. However I'm new to Obj C. Here is the code so far, this is just for 1 sound. I could copy and paste it 10 times. But if all 10 sounds are in an array I'll be able to do more functions with the sounds. - (IBAction)oneSound:(id)sender; { NSString *path = [[NSBundle mainBundle] pathForResource:@"Vocal 1" ofType:@"mp3"]; if (oneAudio) [oneAudio release]; NSError *error = nil; oneAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error]; if (error) NSLog(@"%@",[error localizedDescription]); oneAudio.delegate = self; [oneAudio play]; } thanks
0c1a4cce87c61bd6ed8259faa0186f65dc13bef507ccc0e8a16e3fbbf9833c80
['c2d4e49fa27744149c6bf7fc2f953e4f']
I have 2 views SoundViewController ShowViewController The sound view has a sound on it (IBAction). - (IBAction)oneSound:(id)sender; { if (oneAudio && oneAudio.playing) { [oneAudio stop]; [oneAudio release]; oneAudio = nil; return; } NSString *path = [[NSBundle mainBundle] pathForResource:@"1k" ofType:@"mp3"]; if (oneAudio) [oneAudio release]; NSError *error = nil; oneAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error]; if (error) NSLog(@"%@",[error localizedDescription]); oneAudio.delegate = self; [oneAudio play]; mainText.text =@"test"; } And the ShowViewController needs to display the uilabel thats been pressed from the sound button I want it so once the user has pressed the sound on SoundViewController, the uilabel appear on the showviewcontroller as it appear on the soundviewcontroller at the moment
1d29d510961708bc58d0e7859e2e2dabf6bc1badf037ac5008163828fa919f87
['c2fd31a71fd246c99282fc7027b17d68']
This code in MINIX 3 copies boot monitor's (bootstrap) GDT to the Kernel space and switches over it. But I'm having a hard time understanding the code. In the code, _gdt is the address of an array of descriptor tables declared in C (gdt[GDT_SIZE]). The structure gdt is as follows: struct segdesc_s { /* segment descriptor for protected mode */ u16_t limit_low; u16_t base_low; u8_t base_middle; u8_t access; /* |P|DL|1|X|E|R|A| */ u8_t granularity; /* |G|X|0|A|LIMT| */ u8_t base_high; }; The size of the structure is 8 bytes. The macro GDT_SELECTOR has the value 8. ! Copy the monitor global descriptor table to the address space of kernel and ! switch over to it. Prot_init() can then update it with immediate effect. sgdt (_gdt+GDT_SELECTOR) ! get the monitor gdtr mov esi, (_gdt+GDT_SELECTOR+2) ! absolute address of GDT mov ebx, _gdt ! address of kernel GDT mov ecx, 8*8 ! copying eight descriptors copygdt: eseg movb al, (esi) movb (ebx), al inc esi inc ebx loop copygdt The most confusing line is movb (ebx), al. Please help.
d35c13dc8590dc459af8d1cc5827feab6f93a35e9cde38e56692d7ca5386d5da
['c2fd31a71fd246c99282fc7027b17d68']
In my own Pod, I provide some Localization String files that the users can alter according to their needs. But when they run 'pod update', the files get overwritten and the changes are lost. I don't want to force the user to backup the files. Is there any way to fix this? Any way run a script before 'pod update' runs?
6d3a5058c33f18443229f31768f8630752d31fd76599af446afddec068775da3
['c2fdc77deb794000ac15ceb19345487e']
Ok answer was I declare only once my querybuilder outside of the foreach. Put it inside the foreach and there isn't more error. I also figure out how to do it in one query : $qb = $templateRepository->createQueryBuilder('t'); $qb->update(Template<IP_ADDRESS>class, 't'); $count = 0; foreach ($fields as $field => $value) { $qb->set("t." . $field . "", '?' . $count . '') ->setParameter($count, $value); $count++; }; $q = $qb->where('t.id = ?' . $count . '') ->setParameter($count, $data["id"]) ->getQuery(); $p = $q->execute();
23a7ce9c7251f2be880dcb14f2da85947a0fa4062d5d12b666705d4edca44839
['c2fdc77deb794000ac15ceb19345487e']
I'm working on react/redux for some months, and I create this generic method which is a setState like but for redux state. It work well, but it when I try to use redux dev tools, it crashed. Is there some obvious reason for that ? I don't have any error message, just : redux devtool has crashed case AFFECTVALUE: console.log('--> AFFECTVALUE action :', action.name, action.value); var newState = { ...state }; newState[action.name] = action.value return { ...newState }
3cc374d9c30581f5046f54bcffd715f13e5c6263f309a6531442f0e191796aca
['c2ff7d4788964fc2b5a9090d22e94654']
This was a really valuable read! It helped me to see that I would've probably fallen into the same trap as OP for fear that I would be costing the company millions of dollars, without realizing that I'm not in such a position to make managerial decisions overnight, without first consulting with my superiors. Now I know to be on the lookout for these kinds of things :) Cheers.
783be4d2d2db990d3fe957ef4f4e97b122df7fc6b3b4c72e13b715124ef61c5f
['c2ff7d4788964fc2b5a9090d22e94654']
Hi, so it depends on the theme you're using. when you get the image with [get_the_post_thumbnail](https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/) or [get_the_post_thumbnail_url](https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/), the second parameter is the [size](https://codex.wordpress.org/Post_Thumbnails#Thumbnail_Sizes) of the image. You have to go to the files of your theme where the images are being displayed, and change the size parameter to the ones you created it.
2beed1373dda10e9b7fd0153db443040056ede644b9231f73cc4db23d564b6a4
['c30adb5bae3844a6970d8a19d017a4dd']
Try this block. This solves your problem PackageManager pm = getApplicationContext().getPackageManager(); try { PackageInfo info = pm.getPackageInfo("com.google.android.googlequicksearchbox", 0); Field field = PackageInfo.class.getField("firstInstallTime"); long timestamp = field.getLong(info); Date date = new Date(timestamp); Log.e("DATE", date + ""); } catch (NameNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (SecurityException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IllegalArgumentException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NoSuchFieldException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IllegalAccessException e1) { // TODO Auto-generated catch block e1.printStackTrace(); }
83c213bed72feca69b71c03ddc8df68f6f2db137775170300f87dca703c8e8d7
['c30adb5bae3844a6970d8a19d017a4dd']
first you have to create a static handler inside your main activity: public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } public static Handler myHandler = new Handler(){ @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); Log.e("Test", msg.getData().getCharSequence("MAINLIST").toString()); } }; } then in your socket class: public void OnSerialsData(final byte[] buffer, final int size) { Message msg = MainActivity.myHandler.obtainMessage(); Bundle bundle = new Bundle(); bundle.putCharSequence("MAINLIST", "IS_OK"); msg.setData(bundle); MainActivity.myHandler.sendMessage(msg); } but you have to ensure that your handler must be created before you call OnSerialsData method. I hope this help.
afbb7099689826d303eb068d0c5949b7220ca5ae289d7ac91ae07805f237722f
['c314f6c48fac43e2a5440b681a66d74a']
First of all, you don't need sc to control your services. Just use Stop-Service and Start-Service (is it available in 1.0 ?). Second, however not having tested it myself, you need to do two things: Put your script in an infinite loops, with sleep, or kick of the script every minute from task scheduler. Change you Select-String to use -Quiet option which returns a bool Than it should be as simple as if(Get-Content error.log -Wait | Select-String -pattern "I just died" -Quiet){ #stop and start services here } Hope it helps.
8a18f32f958b6b61c79b37c08f4f9c33a5a605e8eb8472ce1ba8eeed13aa10a3
['c314f6c48fac43e2a5440b681a66d74a']
I believe you have missed the point, that I don't have any issues with Ubuntu, but I do with Oracle Linux. Watching any Ubuntu install on VMWare makes me think that the automated installer does apply some changes either in the guest OS or some internal VMWare Workstation configuration, to make the host accessible by name. I am just wondering what they are, if somebody knows it, or where to look?
a5cf848d89c032e005399264c02d8251b8ee3ed9d530318890498335cd07267e
['c320feaaf3474c6eab96d9637b5ca938']
Just assign a desired address to the href property, instead of trying to replace the whole window.location object: window.location.href = 'myapp://do/xx'; It works for me on iOS 9.0.2, but now safari shows a confirmation dialog to ensure а user really wants open your link in the app.
521af38a8c11cf45755d0778a6a6a6e1aa98a1bdb3b87f20d64534ae8df2f6b2
['c320feaaf3474c6eab96d9637b5ca938']
Any soild reason I should prefer the sass partials over normal sass files (w/o leading underscore in the filename)? I am not a full-time frontend developer and for now I use sass for simple organizing of my css - split styles into different files(modules/components), variables, functions, in-place calculations, mixins - I think that's all I do. In general I create a single main sass files that combines all the files together like that: // main.scss @import 'vars' @import 'funcs' @import 'layout' @import 'component/modal' // etc. And recently I noticed there is such thing as partials. From the documentation I understand partials are independent files that are not exists on their own and are always a part of some other bigger modules. By this logic it looks like vars.scss, funcs.scss are good candidates to be partials. And what I can't understand is why _vars.scss is better than vars.scss. The both variants will work well from the point of view of code splitting. Possible reason is Compilation - the docs page says partials will not be compiled into separate css file. I can't agree that's a feature since it's fully under my control and depends only on how I configure the building tools I use. And anyway such sass internal things like variables/functions/mixins will never be translated directly to css - they only exist in the source code. So I would like to understand maybe it's just a convention for visual separation internal files from others? You know there is a similar old practice of separation private/public members/variables in programming. Or maybe I just miss something? Please advise what I can do with partials what I cannot do with normal files, are there any advantages of first ones?
c57126736baa9b90a3ba9a051f5e24362dd47a303666ecfecfa4c21f5f199a00
['c324b4bd05e940eeabde0a46055ab0a6']
See the concept is very simple. 1) All threads are started in the constructor and thus are in ready to run state. Main is already the running thread. 2) Now you called the t1.join(). Here what happens is that the main thread gets knotted behind the t1 thread. So you can imagine a longer thread with main attached to the lower end of t1. 3) Now there are three threads which could run: t2, t3 and combined thread(t1 + main). 4)Now since till t1 is finished main can't run. so the execution of the other two join statements has been stopped. 5) So the scheduler now decides which of the above mentioned(in point 3) threads run which explains the output.
53f33488b80b4bd4921eeba29d473f0a9641d124cefa53b9135981af3a053c16
['c324b4bd05e940eeabde0a46055ab0a6']
As mentioned by <PERSON> in the comments, don't name your file gensim.py as it will look in local folder first for gensim and consider it as what you are trying to import. PS: I wrote this here as people tend to skip the comments. If it helped, please upvote the original comment.
6062efa336e5e03d1504b77ebb617608f90f4edd350364dd97176ba8889f1025
['c3481e7ee147477993896136621dce40']
I keep getting a "ModuleNotFoundError at /" error when I try to visit my Heroku app. It works fine when I run it on localhost:8000. My project directory looks like this: frontpage -pycache (folder) -migrations (folder) -templates (folder) -__init.py__ -admin.py -apps.py -forms.py -models.py -tests.py -urls.py -views.py Log error: ModuleNotFoundError at / No module named 'frontpage.forms' Request Method: GET Request URL: http://cottonthebutton.herokuapp.com/ Django Version: 3.0.8 Exception Type: ModuleNotFoundError Exception Value: No module named 'frontpage.forms' Exception Location: /app/frontpage/views.py in <module>, line 5 Python Executable: /app/.heroku/python/bin/python Python Version: 3.8.5 Python Path: ['/app/.heroku/python/bin', '/app', '/app/.heroku/python/lib/python38.zip', '/app/.heroku/python/lib/python3.8', '/app/.heroku/python/lib/python3.8/lib-dynload', '/app/.heroku/python/lib/python3.8/site-packages'] Server time: Sat, 1 Aug 2020 19:16:39 +0800 Traceback: Environment: Request Method: GET Request URL: http://cottonthebutton.herokuapp.com/ Django Version: 3.0.8 Python Version: 3.8.5 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'frontpage'] Installed Middleware: ('whitenoise.middleware.WhiteNoiseMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware') Traceback (most recent call last): File "/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/base.py", line 100, in _get_response resolver_match = resolver.resolve(request.path_info) File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 544, in resolve for pattern in self.url_patterns: File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 588, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/resolvers.py", line 581, in urlconf_module return import_module(self.urlconf_name) File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import <source code not available> File "<frozen importlib._bootstrap>", line 991, in _find_and_load <source code not available> File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked <source code not available> File "<frozen importlib._bootstrap>", line 671, in _load_unlocked <source code not available> File "<frozen importlib._bootstrap_external>", line 783, in exec_module <source code not available> File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed <source code not available> File "/app/PersonalWebsite/urls.py", line 21, in <module> path('', include('frontpage.urls')) File "/app/.heroku/python/lib/python3.8/site-packages/django/urls/conf.py", line 34, in include urlconf_module = import_module(urlconf_module) File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import <source code not available> File "<frozen importlib._bootstrap>", line 991, in _find_and_load <source code not available> File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked <source code not available> File "<frozen importlib._bootstrap>", line 671, in _load_unlocked <source code not available> File "<frozen importlib._bootstrap_external>", line 783, in exec_module <source code not available> File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed <source code not available> File "/app/frontpage/urls.py", line 2, in <module> from frontpage import views File "/app/frontpage/views.py", line 5, in <module> from frontpage.forms import MessageForm Exception Type: ModuleNotFoundError at / Exception Value: No module named 'frontpage.forms'
4e217c660b3f4b47917e19409791ca313522722d36e65d330d0b4d2da0004d9b
['c3481e7ee147477993896136621dce40']
I want to make a program that has a part where the user cannot input anything, but the user can press enter to progress. Also, it doesn't show the input. Here's how it should go: System.out.println("Welcome to Earth. Press enter to continue."); //The code that doesn't accept input, except enter System.out.println("Oops. Program has ended. Please wait for 100 years. Thank you!"); I tried doing it by only making the program "move on", if my string is equal to "". public static void main(String[] args) { Scanner scan = new Scanner(System.in); String input; int x = 0; while(x == 0) { System.out.println("Welcome to Earth. press enter to continue."); input = scan.nextLine(); if(input.equals("")) { x = 1; } if(x == 1) { System.out.println("OOps. Program has ended. Please wait for 100 years. Thank you!"); } } } The result is just "Welcome to Earth. press enter to continue." repeating over and over again if it's input is not equal to "".
d3fc2a47f23c99eb09c089fd76a972c7d86aa33a27173fab343def5598814f97
['c34e1c7313b34f7d977fca2884787508']
I feel like I am doing something wrong. I got these installed. Now I see the dongle is actually recognized and the WiFi option appears. However, it doesn't have its usual light indicator, and it doesn't find any networks. I have another nameless brand from AliExpress - same issue.
35d373419aefed71cdbad7c34737ec82521ce20a16792b58b35c0b487a3d3511
['c34e1c7313b34f7d977fca2884787508']
I'm not very strong in SQL statements but I would like to know about a thing I'm willing to know. Imagine a "visible" column that holds 'y' or 'n' values. Is it possible to have only a single 'y' without launching a pre-query that updates this table to 'n' value for all rows before setting the desired row to 'y'? Thanks in advance.
e9238d499984e7d1639e88b2b69bc24a07a4df2ec2f489bd883c1bb344fbd92c
['c35a4dbe04b34d13a4b5e41de01df445']
i am migrating my SSRS deployed on Azure SQL reporting to SSRS hosted on Azure VM. I have successfully created a VM and deployed my reports, which can be viewed from browser. now my requirement is that i want to get the reports in PDF or EXCEL format programatically. that requirment working fine for last one year but as i moved to VM when i called ReportViewer.ServerReport.GetParameters() method it throw an exception 401 UnAuthorized access. i am currently using below class to get authenticate my user to get reports in PDF or EXCEl public class SSRSReportServerCredentials : IReportServerCredentials { public SSRSReportServerCredentials() { } public WindowsIdentity ImpersonationUser { get { return null; } } public ICredentials NetworkCredentials { get { return null; } } public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority) { authCookie = null; user = sa; password = test; authority = SERVER.reporting.windows.net; return true; } } Can any one help me out to fix my production issue. best regards, <PERSON>
1bd579038bd107729658b7c1eede51c1d012897541de541559e48a12404f1ec4
['c35a4dbe04b34d13a4b5e41de01df445']
sorry guys for too much late reply, i have fixed that issue almost 2 months ago but unable to find time to share my findings with you all. i have change the credential file as below and call the parametrize constructor public class SSRSReportServerCredentials : IReportServerCredentials { public SSRSReportServerCredentials() { } public WindowsIdentity ImpersonationUser { get { return null; } } public ICredentials NetworkCredentials { get { return new NetworkCredential(WebConfigurationManager.AppSettings["userName"], WebConfigurationManager.AppSettings["password"]); } } public bool GetFormsCredentials(out Cookie authCookie, out string user, out string password, out string authority) { authCookie = null; user = null; password = null; authority = null; return false; } }
6ef955dc7cf3dd89cb6b36160dcaedc043bd816a138fcaa4574949f7f2231dc0
['c35d71efc81d4a71bf36f3588d0f0d0c']
When selecting a time on iPhone 8, the date picker crashes. TimeZone is an @State variable being changed in a picker. The user is able to selected a date. But when the user selects the time, the date picker collapses, thus the time is not able to be set. I have tested this both on iPhone X and iPhone 12 pro Max, works perfectly. However Xcode always prints out these to warnings: [DatePicker] UIDatePicker 0x10a42b190 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes. Can't find keyplane that supports type 4 for keyboard iPhone-PortraitTruffle-NumberPad; using 25901_PortraitTruffle_iPhone-Simple-Pad_Default The iPhone 8 simulator works as well. Users from TestFlight show feedback and videos of the time not being able to be selected on iPhone 8. Are these warnings the result in the date picker collapsing? If so how can these warnings be suppressed? Am I using the .environment modifier correctly when setting the timezone? Down bellow are two date pickers, both of them have the same problem. Things that I have tried that don't work : Extracting the View as a SubView Removing the .environment modifier Removing the .id modifier Removing the animation modifier Removing the display components parameter Section(footer: Text("Event is being set in \(selectedLocation(locationIndex: site).timeOffSet)")){ Toggle(isOn: $isAllDay){ Text("All-day") } VStack{ DatePicker(selection: $date, displayedComponents: self.isAllDay ? .date : [.hourAndMinute, .date], label: { Text("Date") }).environment(\.timeZone, (TimeZone(identifier: timeZone) ?? TimeZone(identifier: "America/New_York")!)) }.animation(nil) .id(self.datePickerID) VStack{ DatePicker(selection: $date, displayedComponents: self.isAllDay ? .date : [.hourAndMinute, .date], label: { Text("Date") }) .disableAutocorrection(false) .id(2) .environment(\.timeZone, (TimeZone(identifier: timeZone) ?? TimeZone(identifier: "America/New_York")!)) .animation(nil) } }
ef2ce56b884cd818fcff1589e17cf41d23490a9f9e8d13ebfbe9967ff354162c
['c35d71efc81d4a71bf36f3588d0f0d0c']
When Clicking accept in the email, and viewing it in the calendar it still says "has not accepted invite". Im not quite sure why the response to accept the email is not being updated in the calendar. Please help thanks! I am using outlook as the email service. Thanks again for the help much appreciated #imports import smtplib from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.utils import formatdate from email import encoders import os,datetime COMMASPACE = ', ' CRLF = "\r\n" #Account that creats the Meeting login = "<EMAIL_ADDRESS>" password = "Password" attendees = ["<EMAIL_ADDRESS>", "<EMAIL_ADDRESS>", "<EMAIL_ADDRESS>"] organizer = "ORGANIZER;CN=Test:mailto:admin"+CRLF+"@gmail.com" fro = "nickname <<EMAIL_ADDRESS>>" ddtstart = datetime.datetime.now() dtoff = datetime.timedelta(days = 1) dur = datetime.timedelta(hours = 1) ddtstart = ddtstart +dtoff dtend = ddtstart + dur dtstamp = datetime.datetime.now().strftime("%Y%m%dT%H%M%SZ") dtstart = ddtstart.strftime("%Y%m%dT%H%M%SZ") dtend = dtend.strftime("%Y%m%dT%H%M%SZ") description = "DESCRIPTION: test invitation from pyICSParser"+CRLF attendee = "" for att in attendees: attendee += "ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ- PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE"+CRLF+" ;CN="+att+";X-NUM-GUESTS=0:"+CRLF+" mailto:"+att+CRLF ical = "BEGIN:VCALENDAR"+CRLF+"PRODID:pyICSParser"+CRLF+"VERSION:2.0"+CRLF+"CALSCALE:GREGORIAN"+CRLF ical+="METHOD:REQUEST"+CRLF+"BEGIN:VEVENT"+CRLF+"DTSTART:"+dtstart+CRLF+"DTEND:"+dtend+CRLF+"DTSTAMP:"+dtstamp+CRLF+organizer+CRLF ical+= "UID:FIXMEUID"+dtstamp+CRLF ical+= attendee+"CREATED:"+dtstamp+CRLF+description+"LAST-MODIFIED:"+dtstamp+CRLF+"LOCATION:"+CRLF+"SEQUENCE:0"+CRLF+"STATUS:CONFIRMED"+CRLF ical+= "SUMMARY:test "+ddtstart.strftime("%Y%m%d @ %H:%M")+CRLF+"TRANSP:OPAQUE"+CRLF+"END:VEVENT"+CRLF+"END:VCALENDAR"+CRLF eml_body = "Event on Calendar test" eml_body_bin = "This is the email body in binary - two steps" msg = MIMEMultipart('mixed') msg['Reply-To']="<EMAIL_ADDRESS>" msg['Date'] = formatdate(localtime=True) msg['Subject'] = "Testing Event"+dtstart msg['From'] = fro msg['To'] = ",".join(attendees) part_email = MIMEText(eml_body,"html") part_cal = MIMEText(ical,'calendar;method=REQUEST') msgAlternative = MIMEMultipart('alternative') msg.attach(msgAlternative) ical_atch = MIMEBase('application/ics',' ;name="%s"'%("invite.ics")) ical_atch.set_payload(ical) encoders.encode_base64(ical_atch) ical_atch.add_header('Content-Disposition', 'attachment; filename="%s"'%("invite.ics")) eml_atch = MIMEText('', 'plain') encoders.encode_base64(eml_atch) eml_atch.add_header('Content-Transfer-Encoding', "") msgAlternative.attach(part_email) msgAlternative.attach(part_cal) mailServer = smtplib.SMTP('smtp.outlook.com', 587) mailServer.ehlo() mailServer.starttls() mailServer.ehlo() mailServer.login(login, password) mailServer.sendmail(fro, attendees, msg.as_string()) mailServer.close() print("Email Sent")
e92ceca595dc6f9c6a4a14a4addea1f77ca1c07ab99be54d40d6bd153b808431
['c35f60f6056d49ec988ae807d7cca5a6']
How do I increase the amount of Primary Storage available in CloudStack. I followed the Quickstart guide for cloudstack4.2. I added the /primary and /seconday nfs and have a management and agent cloudstack service. All the primary folders are showing as 49.22 GB no matter what. I'm running this in Centos 6.4 on dual core Xeon computers with one master and several hosts. I have 1 TB hdds on all hosts and the master (which I would like to utilize fully). How can I increase the size of the primary storage?
aa844dbe5ce3c3e1acdda53b388699490b8f82259f4f91771d02fe6db50d1f5c
['c35f60f6056d49ec988ae807d7cca5a6']
Do you have a manifest? There's normally a default manifest: http://docs.oracle.com/javase/tutorial/deployment/jar/defman.html You have to set an entry point: http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html Basically, create a META-INF\Manifest.MF file. Then, and add "Main-class:<your main class> e.g. com.example.blahclass" (if you're not using packages, then don't keep the com.example part)
5aa47c6d1d327e2304285e6c595b313868c15870428633a1178b84218abf9b60
['c362cdaf256e4c6495f3a6e2c71fca98']
я построил SQL запрос return self<IP_ADDRESS>find()->select(['video.id', 'video.name', 'info_downloads.quantity']) ->leftJoin('video', 'video.id = info_downloads.video_id') ->orderBy(['info_downloads.quantity' => SORT_DESC]) ->limit($count) ->all(); но в ответ получаю только video id [0]=> object(api\modules\v1\models\InfoDownloads)#162 (10) { ["_attributes":"yii\db\BaseActiveRecord":private]=> array(1) { ["id"]=> int(9) } ["_oldAttributes":"yii\db\BaseActiveRecord":private]=> array(1) { ["id"]=> int(9) } ["_related":"yii\db\BaseActiveRecord":private]=> array(0) { } ["_relationsDependencies":"yii\db\BaseActiveRecord":private]=> array(0) { } ["_errors":"yii\base\Model":private]=> NULL ["_validators":"yii\base\Model":private]=> NULL ["_scenario":"yii\base\Model":private]=> string(7) "default" ["_events":"yii\base\Component":private]=> array(0) { } ["_eventWildcards":"yii\base\Component":private]=> array(0) { } ["_behaviors":"yii\base\Component":private]=> array(0) { } } как мне правильно получить данные , которые я указал в select
7196e1869cdb80695f84d3834b7fb985f57b7d320aa22d11cb40048649a7481f
['c362cdaf256e4c6495f3a6e2c71fca98']
Specifically, how do I get it to pop up as the numbers entry screen but still be able to switch to letters? What I'd really like, ideally, is to have it act the same as if we had the xml property <EditText ... android:inputType="textShortMessage"/> but come up on the number entry screen (the one you get by clicking "?123") on first showing, rather than the usual qwerty one. I've tried doing eg <EditText ... android:inputType="textShortMessage|number"/> but all that does is default it to the phone-number-entry screen with no option to enter letters. Any ideas?
e36d3f189949fdcff6809cfaa8190ba0b8325a4f5d1c6c889c3b39c79bc3fc9f
['c36924b0088d42fcaa6e20648a207b21']
I am creating a wordpress blog that has small boxes for each post thumbnail. When you click one, it expands and loads the post with ajax. For this functionality, I would want to load JUST what's in the post, and not a bunch of extra html around it. However, in order to provide permanent links or the ability for people to share posts and link directly to them from Facebook or whatever, I will still need a single post template that DOES include all the extra html and page formatting. In short, I'd like to be able to link to a single post using its permalink, and additionally I'd like to be able to bring in the stripped down version of it using a jquery .load() Here's what I have in my functions file: function my_template_redirect() { global $wp_query; if ( 'ajax' == $wp_query->query_vars['name'] ) { $wp_query->is_404 = false; status_header( 200 ); $args = array( 'p' => $post->ID, 'post_type' => $post->post_type ); query_posts( $args ); the_post(); load_template( TEMPLATEPATH . '/ajax-single.php' ); die(); } } add_action( 'template_redirect', 'my_template_redirect' ); So now, when I load a post using its normal permalink, like ( www.page.com/permalink ), it loads the normal single.php version, and when I load a post like this: ( www.page.com/permalink/ajax ) it shows a stripped down version using ajax-single.php as the page template. The problem is, it's loading ALL the posts at once in the ajax version, rather than just the one in question. How do I make sure it's only loading the one that I want?
f63b0d414ccc05e15ebbd37c8d97f663ea8fe7fe1261fa62fa95bfe7eb589e1a
['c36924b0088d42fcaa6e20648a207b21']
I discovered the best solution in an article called Developing Sites With AJAX: Design Challenges and Common Issues The reason this is the best solution is because when you make an ajax call to load a page fragment, it loads the entire page first and then returns the fragment. You improve this functionality by using php, which when placed in the page in the following manner, will only return the data requested by the server. The first option responds to the page being loaded by any jquery .load() function, and the second responds when the page is loaded by a browser in the typical manner. <?php if($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest'){?> This is content requested by AJAX. <?php }?> <?php if($_SERVER['HTTP_X_REQUESTED_WITH']==''){?> This is the normal content requested in a browser <?php }?> Here is an example: http://icant.co.uk/articles/things-to-know-about-ajax/header-switching.html Make sure to check out the full article to see more details on how it can be correctly applied in Wordpress.
a4687f0b2280aaa1773a308c6a250faad66a00d70ea26103f8a39acbe350bd7b
['c37ac1e00e444c699b1736b17a5b9a14']
We are thinking of implementing analytics for our webapp so that we can trigger custom event from backend (php), google analytics doesn't have the depth we need for information like tracking emails and user status, the google tags looks promising but I can't figure out how to trigger the tag to work from backend. Since inside tag manager we can configure custom events as trigger, I was wondering if there's a way to setup a custom trigger using measurement protocol or something similar please excuse me if this turned out be a stupid question, thanks in advance.
ca11471b0f81c364bada87f6c4de602059828237dcf5241fc06918f650dac3ee
['c37ac1e00e444c699b1736b17a5b9a14']
I m trying to understand what happens when assigning a variable a which already stores a reference to an object instance MyClass to a new variable b. E.g. var a = new MyClass("some name"); //assume instance has an address 1, var a's address is 2 and the value is the address of object instance(1). var b = a; I thought the value stored in b would be the address of a which is 2, but it seems when I output the value of b the result is actually 1. e.g. setName(ref a, "NEW NAME"); public void setName (ref MyClass instance, string name) { instance = new MyClass(name) } Console.WriteLine(a.Name); Console.WriteLine(b.Name); The output is NEW NAME //a.Name some name //b.Name I was expecting both variables' names to change since I thought b is storing a pointer to a. but it seems b is storing the value of a instead of its address? Thanks in advance
dba9bc6df0a593834d72040e09863d6a87eba2e2f0591c4b5f2808cdf79e6c23
['c381429d3822417ab1416dc1bca802fc']
<PERSON> I have worked with DTW in my diploma thesis, which was a while ago. I know there are some clustering approaches based on DTW, but I am not sure about the details (except that means based clustering does not work). There is a direct question on DTW based clustering (https://stats.stackexchange.com/questions/131281/dynamic-time-warping-clustering) but the tendency seems skeptical of that approach.
42e94fb98dc7b2cee23aa47b925f9d132ba9b93b8e9baea47d86c1aa195e3d80
['c381429d3822417ab1416dc1bca802fc']
If your PA system is similar to the likes of the Yamaha StagePas 500, then it offers a similar functionality to the Behringer Mixer. As such, you may wish to bypass the mixer altogether and plug your microphones directly to the PA Mixer. However, your Behringer mixer may offer some added functionality to your PA mixer (like better EQs or on-board effects). Also, using the Behringer mixer may give some extra flexibility as to where the mixer is placed. I may be able to provide a more accurate answer if you spell the model of both your PA and Behringer mixer.
3e3b330d60736a4053bb034d3b08c610338e065144bbe7273f0697901df4187b
['c38b3627ec6b4d88a3df179c3d6c42be']
Simple steps on Android phone. Search for route on Android phone. Click on start Navigations button with whatever route it is suggesting. Then Magnifying symbol will appear. Tap on the magnifyling symbol. "Search along route" will appear. Here type the point through which the map should navigate and click on the name once it appears. Now your new suggested route navigation will appear. This is the simple and best step.
d41cb2603055874b5af0e5c624b10a126e885589641501cabd3acd0bf8d46a20
['c38b3627ec6b4d88a3df179c3d6c42be']
I have some problems in spacing. I just want to put equations in the text. What I found is that the vertical spacing between the equation and text is not consistent. Some is large and some is small. Both spacings above and below equation are not consistent. How do I get consistent spacing in the entire thesis? I can adjust spacing using \vspace{\baselineskip}. But I am not sure the spacing is exactly the same or not. It doesnt seems good solution. Here is my code. \documentclass[twoside]{utmthesis} %According to the new manual, should not mixed single-side with two-side printing \usepackage{graphicx} \usepackage{url} %\usepackage[pages=some]{background} \usepackage{lipsum} \usepackage{pdflscape} \usepackage{verbatim} \usepackage{textcomp} \usepackage{mhchem} \usepackage{amsmath} \usepackage{listings} \usepackage{graphicx} \usepackage{mwe} \usepackage{xr} \usepackage{siunitx} \usepackage{float} \usepackage{subfig} \newsavebox{\bigleftbox} \usepackage{tikz} \usepackage{nameref} %\usepackage[printonlyused]{acronym} \usepackage{romannum} \usetikzlibrary{shapes.geometric, arrows} \usepackage{natbib} \let\cite\citep \bibliographystyle{utmthesis-authordate} \begin{document} \subsection{1D numerical modeling of the SI-engine} \vspace{\baselineskip} The numerical models and related equations applied in the 1D engine simulation are presented and briefly discussed. \subsubsection{Pipe} \vspace{\baselineskip} In one-dimension modeling of flow through the pipes, working fluid is assumed that it is flowing in one-direction, instead of three direction (X, Y, and Z). It seems plausible, as most fluid particles are moving mostly in longitudinal direction rather than radial direction of the pipe. A one- dimensional pipe flow is described by Euler equation which is given in conservation form below. \begin{equation} \label{Euler} \frac{\partial \mathbf{U}}{\partial t} + \frac{\partial \mathbf{F(U)}} {\partial x}= \mathbf{S(U)} \end{equation} $\textbf{U}$ and $\textbf{F}$ represent state vector and flux vector, respectively which are represented as follows. \begin{equation} \mathbf{U}= \begin{pmatrix} \rho \\ \rho \cdot u \\ \rho \cdot \bar{C_v} \cdot T + \frac{1}{2} \cdot \rho \cdot u^2 \\ \rho \cdot w_j \end{pmatrix}\,\,\, , \,\,\, \mathbf{F}= \begin{pmatrix} \rho \cdot u \\ \rho \cdot u^2 + p \\ \rho \cdot (E+p) \\ \rho \cdot u \cdot w_j \end{pmatrix} \end{equation} With total energy, $E$ is given as below. \begin{equation} \label{E} \begin{split} E=\rho \cdot \bar{C_v} \cdot T + \frac{1}{2} \cdot \rho \cdot u^2 \end{split} \end{equation} The source term, $\textbf{S}$ is divided into two different sub-source terms. \begin{equation} \label{S} \mathbf{S(U)}= \mathbf{S_A(F(U))} + \mathbf{S_R(U)} \end{equation} $\mathbf{S_A}$ is the source term caused by axial changes in the pipe cross section. \begin{equation} \label{Sa} \mathbf{S_A(F(U))}= - \frac{1}{A} \cdot \frac{dA}{dx} \cdot \left(F + \begin{pmatrix} 0 \\ -p \\ 0 \\ 0 \end{pmatrix} \right) \end{equation} $\mathbf{S_R}$ is the source term taking into account homogeneous chemical reaction, friction, heat and mass transfer between gas and solid phase. \begin{equation} \label{Sr} \mathbf{S_R(F(U))}= \begin{pmatrix} 0 \\ -\frac{F_R}{V} \\ \frac{q_w}{V} \\ M W_j \cdot \left(\sum\limits_{i}^{R_{hom}} \nu_{i.j} \cdot \dot{r_i}\right)\end{pmatrix} \end{equation} \bibliography{reference} \end{document}
4defe5208ae734a22ed9bd7de236c5f8a7dba9b402188e960f15d5a5c95a98de
['c39b69412aa443228043e4ba55e43b86']
Got it working. The solution is to call the ExecuteMso method with the Control Name value from the OutlookAppointmentItemControls.xlsx file. And it only seems to work if you call the ExecuteMso after the Display method has been called. Below is the code to create a new Appointment (meeting) with a recipient, and show the Schedule Assistant view in the Inspector window. AppointmentItem newAppointment = Globals.ThisAddIn.Application.CreateItem(OlItemType.olAppointmentItem); newAppointment.MeetingStatus = OlMeetingStatus.olMeeting; Recipients recipients = newAppointment.Recipients; Recipient readyByRecipient = null; readyByRecipient = recipients.Add(emailAddress); readyByRecipient.Type = (int)OlMeetingRecipientType.olRequired; recipients.ResolveAll(); newAppointment.Display(); Inspector inspector = newAppointment.GetInspector; inspector.CommandBars.ExecuteMso("ShowSchedulingPage"); Marshal.ReleaseComObject(readyByRecipient); Marshal.ReleaseComObject(recipients); Marshal.ReleaseComObject(newAppointment); Marshal.ReleaseComObject(inspector);
e969b6414c593c8e2f0fa246c5c8e02183bffa5327dd2cc25020f7f314a3e021
['c39b69412aa443228043e4ba55e43b86']
Use the PrintOut method on the MailItem object to print out an email. Explorer Window Code If your ribbon button is displayed in the Outlook Explorer window you can print out all the selected emails using the following code: Explorer explorer = Globals.ThisAddIn.Application.ActiveWindow() as Explorer; Selection selection = explorer.Selection; for (int i = 1; i <= selection.Count; i++) { var selectedItem = selection[i]; if (selectedItem is MailItem) { MailItem mailItem = selectedItem as MailItem; mailItem.PrintOut(); } Marshal.ReleaseComObject(selectedItem); } Marshal.ReleaseComObject(selection); Inspector Window code And if your button is displayed in the Inspector window you can print out the email using the following code: Inspector inspector = Globals.ThisAddIn.Application.ActiveWindow() as Inspector; var currentItem = inspector.CurrentItem; if (currentItem is MailItem) { MailItem mailItem = currentItem as MailItem; mailItem.PrintOut(); } Marshal.ReleaseComObject(currentItem); ReleaseComObject Also notice I've used the ReleaseComObject method to release the COM objects. For more information about when to use the ReleaseComObject method see When ReleaseComObject is necessary in Outlook
0d2de7df6cead02e76d77b60df9a834e23a3e569b3516316bd5755db9d959ea4
['c39e9a30533149fdbd48dca5cc176368']
In some cases changing only visibility, the attribute might still end up as allocated blank space (because of parent view's padding, margins, inner elements, etc). Then changing the height of the parent view helps: holder.itemView.setVisibility(View.GONE); holder.itemView.setLayoutParams(new RecyclerView.LayoutParams(0, 0)); Then be sure that in the condition that it should be visible, also set: holder.itemView.setVisibility(View.VISIBLE); holder.itemView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); You need to do that because the viewHolder is recycled as you scroll, if you change properties like this and never return them to their natural state, other elements will be already hidden in the event they reuse the same view.
6f50adb17700cc53e6f04174b93fa098e120ff4ec83c686469bde6df8931d673
['c39e9a30533149fdbd48dca5cc176368']
Update your Eclipse ADT Plugin to 22.0 or higher, then go to File | Export 2. Go to Android now then click on Generate Gradle build files, then it would generate gradle file for you. 3. Select your project you want to export 4. Click on the finish now Import into Android Studio In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window. Click Import Project. Locate the project you exported from Eclipse, expand it, select it and click OK.
68c4c6593392cab3a73fd705e048168062fff4b51ddc3c91316a69ae57eaa725
['c3a1f61aedf94fe5801600645384cda4']
I have found the solution, I've changed the code at the beginning and that was helpfull: def coordinates(): abc=open('file.txt') lines=abc.readlines() for line in lines: abc2=line[20:-7] #i just cut the lines from the begining and from the end, and i dont need to take data from the middle abc3=abc2.split() pd.DataFrame(abc3) print abc3 coordinates()
5f5d4366792475a4f2e5b0c995a5840d1832c84be09851c0635454c9b98c46a4
['c3a1f61aedf94fe5801600645384cda4']
In my large dataset i have one column with names like this: main file: 1, NAME1 2, NAME2 3, NAME2 ... all i need is, to create 3rd column with surnames, with some conditions. I have 2 text files with single words(SURNAME1.txt, SURNAME2.txt). I need to create condition where i can use it to create 3rd column, for example: if NAME1 in 'SURNAME1.txt': then create field in 3rd main file where will be written 'SURNAME1' right now i can check where my names are with this code: if ('NAME1') in open('SURNAME1.txt').read(): print ("true") on output i need to receive in my main file: 1, NAME1, SURNAME1 2, NAME2, SURNAME2 3, NAME2, SURNAME2 Thanks in advice
59a8c80bc34af524c191a5bd93f519a0765f96d63d2fe18cabce0d16c92428d6
['c3a4214cff91486c9f08ea7fa450bbc2']
Yes, it is spelled correctly. German is often very literal and spelling is quite often (especially with compound nouns) linked to the meaning of the word. As a native speaker I understand this kind of words like a combination of what you use a thing for (or what it does, or what you do to / with it) and what kind of it is itself. This - very literal - type of words is quite common and special thing to the German language. For Example: Flugzeug (Aircraft): Flug- (derived from fliegen, to fly) -zeug (gear) = flying-gear Druckmaschine (printing press): Druck- (derived from drucken, to print) -maschine (machine) = printing-machine Schiebetür (sliding door): Schiebe- (from schieben, to push forward) -tür (door) = pushing-(/sliding-)door The Scheißhaus is spelled Scheißhaus because it is literally a (okay, more or less) 'house' to have a shit in - and the reason for some germans to somewhat ironically use this word, or the also popular "Kackstuhl", to describe a toilet maybe lies in that ludicrous literal way of describing things that makes you giggle. Remember: These metaphors are colloquial, sloppy, and bad taste. So maybe don't use them. The the metaphors are brilliant though. Even five years later.
3eb73dc20ef270c9236d441e9b340688e52a26276a4015e1a2f4cf753175896b
['c3a4214cff91486c9f08ea7fa450bbc2']
We have a 2003 Honda Odyssey with built-in nav and stereo. The two were integrated -- the nav audio went through the stereo, there was also a mute signal to signal the stereo to play the nav audio on the front speakers. I replaced the stereo a few months ago which severed any navigation audio. We bought a BC23A 15 watt powered speaker as a workaround. After wiring it to the nav system, the audio was too quiet. (I turned the powered speaker up, and turned the nav system all the way up.) Hooking the BC23A directly to an ipod gave me audio much louder than I needed, so I know the speaker works. My assumption is the line level from the nav system is too low for what the BC23A is expecting. I began thinking I should make/buy a small amp to raise the line level before it gets to the BC23A. Then I found the MAX9744 at adafruit. The specs say: The outputs are Bridge-Tied-Load which means you can only connect speakers up directly. Don't connect the outputs to another amplifier!  So I can't put it in series with the BC23A. Then I realized that this amp is probably sufficient to replace the BC23A. The specs for the MAX9744 say this about the input level: This audio amplifier takes in stereo audio, either using a 3.5mm stereo jack or terminal blocks. Line in audio is a-OK. The audio inputs are not differential! The ground connection is connected directly to the power ground, this chip simply does not handle differential inputs. However, the inputs do have blocking capacitors, so if your audio levels have DC bias, its OK to connect them up directly without extra audio blocking caps. I believe this is sufficient to put in and connect directly to a speaker, maybe recycling the BC23A as a non-powered speaker. A friend suggested I amplify as near the source as possible -- so I am thinking of running the amplified output from behind the stereo to the remote speaker, rather than running line level to a modded BC23A. My questions: Does this sound like a reasonable plan? How important is it to place the amp near the source? It would be convenient to just gut the BC23A and put it in there! (Maybe I should just do that initially since this isn't hi-fi music we're talking about.) I would like to use the "stereo mute" signal from the NAV system to turn the amp on and off -- to reduce hiss when not operating. The amp has a SHDN pin that shuts down the amp when grounded. I believe the nav system has a mute signal (high) when speaking. What's the simplest / reliable way to switch this? Is it as simple as this? What value should R be? R [MAX9744 SHDN] ----+----\/\/\/\/\--- [MAX9744 GRND] | +----- [NAV MUTE]
31c21d7147dcefc0514b595218f8d2683de4e8f2949ef5c1b351a83d8ab52225
['c3a4c23856ee44c8b66ea3bb9c2c03d2']
http://jsfiddle.net/9r246chg/ Here is a working demo. and the code inside is as such html <input id="myInputText" type="text" name="inputBox" /> <a id="anchor" target="_blank" href="">Search on google</a> javascript/jquery $('#myInputText').on('input', function (e) { $("#anchor").attr("href", "https://www.google.com/?gws_rd=ssl#q=" + $(this).val()); $("#anchor").html("Search " + $(this).val() + " on google"); }); notice all I'm doing is detecting a change on the input and then setting the attribute and inner html.
7eaec84a8fddfd9190ca6354c2da180d48b2331bc6e6f9cb20edd7cb474200b4
['c3a4c23856ee44c8b66ea3bb9c2c03d2']
I am brand new to Webstorm and live templates. But after doing some researching I can't figure out how to include the project name into a live template. It looks like its easy enough in a regular template ${PROJECT_NAME} but I can't find a $PROJECTNAME$ equivalent for live templates. Does this not exist?
5ebc082e324ff73e3bc688f36b413ef504c961698f0b70c6e074772d1ef1fdf6
['c3b6cb598cbb4cf6aec6f85971104a60']
1)You should use RecyclerView insteaad of listView, and for recyclerView you can achieve what you want with item decorator. 2)But if you have to use ListView(which is less possible case) you can do this by checking list item position and set the corresponding margin to the layout which is not recomended. 3)Also there is another way to achieve this, which is to use different layout resource xml files, but I would not use the last two variants. I would prefer the first.
0bb472e2b0c2c6ec95f6d8543463bc740e9e1a1761c690f1e20118305e66434d
['c3b6cb598cbb4cf6aec6f85971104a60']
@override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { int width = 320; int height = 240; if (mCameraSource != null) { Size size = mCameraSource.getPreviewSize(); if (size != null) { width = size.getWidth(); height = size.getHeight(); } } /* Swap width and height sizes when in portrait, since it will be rotated 90 degrees */ if (isPortraitMode()) { int tmp = width; width = height; height = tmp; } final int layoutWidth = right - left; final int layoutHeight = bottom - top; for (int i = 0; i < getChildCount(); ++i) { getChildAt(i).layout(0, 0, layoutWidth, layoutHeight); } try { startIfReady(); } catch (IOException e) { Log.e(TAG, "Could not start camera source.", e); } } ******** Also do not forget to comment this line:*** mCameraSource = new CameraSource.Builder(context, myFaceDetector) // .setRequestedPreviewSize(640, 480). This line need to be commented or deleted .setFacing(CameraSource.CAMERA_FACING_FRONT) .setRequestedFps(15.0f) .build(); Here is the right answer, which is working on portrait mode, I did't check it on landscape mode, but it should work, because I am setting the layout width and height according to the screen sizes.
15ae6012c2035958c0ac23dae4074507e1eb7f689c7389d9ae7f3b1d5dda4a3a
['c3b8163d022d4b98b4d97263eb523240']
could you let me know if what I'm trying to do here is achievable somehow? I have a feeling that INDIRECT could come in handy, but my mind hasn't been able to come up with how that would look. My goal is similar in concept to a What-If Analysis, but instead of a table, it would be using a single cell formula referencing a master formula and some inputs. What-If doesn't work here, because the inputs are not neatly organised in my analysis sheet. Here's the story: I am creating a spreadsheet ("AnalysisSheet") I use for predicting and analysing results during beer brewing. I take many measurements throughout the process for quality control, and very often the same formula will be applied to the multiple raw data points at various steps for analysis (e.g. conversion of hot liquid volume to cold liquid volume with simple thermal expansion approximation). These formulas can be complex and therefore messy to repeat each time, therefore I would like to create a separate sheet ("FormulaSheet") that has the "master" formulas neatly laid out (along with dummy inputs), so that I can simply reference those master formulas from the "AnalysisSheet" along with input values to be substituted into the dummy inputs. Here's an example of a simple formula: In "FormulaSheet": A1: 20 [Volume dummy input value] A2: 80 [Temperature dummy input value] A3: =A2*(1-0.04*(A3-20)/80) ["Master" formula] Now in "AnalysisSheet": F7: 90 [Temperature reading] F11: 40 [Volume reading] F13: = Calculation as FormulaSheet!A3, but replacing its input reference FormulaSheet!A1 with AnalysisSheet!F11, and FormulaSheet!A2 with AnalysisSheet!F7 My question is basically: What would need to be inserted into F13 for it to perform what I describe?
b5803d891223fcb5d24b4e43de272fe2cffc8b1c91b3b1d1335a87174424d04f
['c3b8163d022d4b98b4d97263eb523240']
Thanks <PERSON> - I figured I was trying to do something beyond the capability of simple cell formulas. VBA function seems to be a decent route here, and I appreciate your clear instructions on how to implement. Indeed I was hoping I could avoid VBA, for file compatibility reasons (i.e. opening xlsm on mobile device for referencing) and of course the added work, as I will still have the master formula sheet for quick semi-manual "calculator tools" usage. If someone knows how to avoid VBA functions here, I would be delighted! Else I will resign to do the double work :)
9b90f80353023287f2943a8ce3bd93230698e5ae806a59bcfdee5dade5630e51
['c3d8e7c7f18f455f89736b3a3724e8e8']
"k" is a function defined inside "mapM" and so, only mapM can see that. In their definition "k" receives two parameters named "a" and "r". Because "k" function is being used in "foldr" it's expected that these two parameters play the next role: "a" - will be every element inside the list "as" "r" - at first it will be "return []", but next time "r" will take the result of "k" applied to "a" and "r" (like an accumulator)
8be3d1886a873132a4ce1cbe39642443226e8349b88ba5c4b3a332a5c6103341
['c3d8e7c7f18f455f89736b3a3724e8e8']
i have the same problem but only is on the Mac OS machine, the problem is that Firefox treat the ajax response as an "cross domain call", in any other machine works fine, im not find any help about this (i think that is a firefox's implementation issue),but i going to prove the next code in the server side: header('Content-type: application/json'); to ensure that browser get the data "as json data" ...
c56e973d5169eb6174c569c6537e4b8c000206d677fd7979d25b44009bd03ce6
['c3e1d416d0934ef1b7b0ddcc17408964']
There are many "Best Practices" found on the Internet. Not everything I wrote is right 100% under any circumstances. Not everything you find is still up to date. One thing I can tell you: "Priority Boost" is bad! https://www.brentozar.com/blitz/priority-boost/ And for Fill Factor: Test it an see if it helps performance. If not reset it. Don't just enable it globally and trust that it will somehow make everything better.
b048a8bb64eb5a3221543779559243dcac5bd24092a8b1d1c123890542643569
['c3e1d416d0934ef1b7b0ddcc17408964']
To find a performance problem I use "top" commands TIME column in cumulative mode (which is important for me because it also captures all the small executed child processes) When any changes in the software have been made I want to see the impact e.g. after 1h. How to reset or clear the TIME+ counter to start from the beginning? To restart the whole system is not an option.
1513114990d018668271534cc568e621559c92a4c11c5466e1e8907d727011d2
['c3e597671d204e99ac7241f06aeeaaae']
To create a category template for a custom post: get the category object using; <?php $term = get_queried_object(); ?> you can then echo this, as a page title, so that your users will know they are browsing a certain category, then using it in the custom query parameters. <?php echo $term->name; ?> // shows category name $args = array( 'post_type' => 'portfolio', 'category_name' => $term->slug );
9eb6d080359ccae0b24dcb25ecf0f34223f5ba8fd33593fe40c72cf820124a7c
['c3e597671d204e99ac7241f06aeeaaae']
try login using a different browser, also make sure it's not zoomed in (CMD+0) copy this code in themes function.php to permanently disable fullscreen mode if (is_admin()) { function pt_disable_editor_fullscreen_by_default() { $script = "jQuery( window ).load(function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } });"; wp_add_inline_script( 'wp-blocks', $script ); } add_action('enqueue_block_editor_assets','pt_disable_editor_fullscreen_by_default' );}
0129c07994bb180ac2808938b26b71aab8bb7f9f466cdb3d38bc7e471b712424
['c3ec1db8a23a4f00a90c92f902cf3647']
I used link_to_active gem to add the "active" class based on the current url. My requirement is, say for example: Student Resource has: /students /students/new /students/id /students/id/edit My usage of link_to_active : is <%= link_to "Students", students_path, class: "list-group-item", active_on: students_path%> obviously students_path coincides only with /students but what if I want keep this link active when i visit the subsequent links as mentioned above. How do i do that?
38c610fcf5e11cae33cc735e53b733b1577e1f8e96abbe4959c2cd69c91f04cf
['c3ec1db8a23a4f00a90c92f902cf3647']
You can visit https://v4.angular.io/docs for Angular 4 docs, and the ngClass API you are looking for is in https://v4.angular.io/api/common/NgClass. For other versions, you can click through white button (which opens up different release versions) on the left navigation bar on https://angular.io/.
cdbfce321b702fe3fb24f8dc335bc213d8930b90fdf471bea51392808af1040e
['c3fe8a373775497280ee50d926997d0c']
I had the same problem. After looking into sources I found a workaround (a little bit hacky, but I found no alternatives). public class YourDialog extends BottomSheetDialogFragment { //your code @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new FitSystemWindowsBottomSheetDialog(getContext()); } } public class FitSystemWindowsBottomSheetDialog extends BottomSheetDialog { public FitSystemWindowsBottomSheetDialog(Context context) { super(context); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getWindow() != null && Build.VERSION.SDK_INT >= 21) { findViewById(android.support.design.R.id.coordinator).setFitsSystemWindows(false); findViewById(android.support.design.R.id.container).setFitsSystemWindows(false); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); } } } And, finally, don't forget to add android:fitsSystemWindows="true" at the root of your dialog layout. Hope it helps.
f3f91a48776156e99c1552d0e7726b654fa740d6fcae726785a972f92201a9fa
['c3fe8a373775497280ee50d926997d0c']
I think your code didn't work, because container is null. Method onCreateView gives you @Nullable ViewGroup container, which is null for DialogFragment (but non null for Fragment). So when you call View.inflate(getContext(), R.layout.dialog_layout_2, container), it just creates a view in memory and doesn't attach it to container, cause it is null. See LayoutInflater.inflate, cause View.inflate is just a convenience wrapper for this function. I dont think there is an easy way to change views inside of the same DialogFragment so what would be the best way to do this? Instead of changing dialog root you can just manipulate child views inside dialog root layout (add, remove them, or change visibility). Also my advice is to use recommended way to create dialog with custom layout (onCreateDialog + setView), but if you don't want to do that, you can refer view you've created in onCreateView as dialog root.
ac9c4a1b151a09a22c8438474732a429e2fd71eb230521354aac6f6b8b9b7f77
['c4143842a9c84286ac3502c71c98cc6e']
Don't store images in database because it's useless. Instead of this, store in database only path to file and file save on server. So... <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="file"> <select name="category"> <option>Nature</opton> <option>People</option </select> </form> <?php if(isset($_POST['category']) && isset($_FILES['file']['tmp_name'])){ //mysql connect etc move_uploaded_file($_FILES['file']['tmp_name'], path/where/to/save/file); mysql_query("INSERT INTO table VALUES('{$_FILES['file']['name']}', '{$_POST['category']}')"); }
cbb60b10190f10bca6f369af9236794dc4c258dd2cf7b7a0dc95a49d8488e742
['c4143842a9c84286ac3502c71c98cc6e']
This is my module "auth" -auth/ -controllers/ ---AuthController.php in controller I have action "register" In layout I create route url: $this->createUrl('auth/auth/register') Rules are in config/main.php 'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'rules' => array( 'register' => 'auth/auth/register', '<controller:\w+>/<id:\d+>' => '<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', '<controller:\w+>/<action:\w+>' => '<controller>/<action>', ), ), When I'm in mySite/index.php register url looks well: mySite/register. Url works and view is visible. When I'm this view mySite/register here starts a problem. Register url is mySite/auth/auth/auth/register - of course i see 404 error. Why it apeears and how to solve this problem?
1dffbb8d9ca31bafaaa2040dd74d1474f93048246502793133b182087c49b110
['c42d1feead104448ade1a97515519b9c']
@LightnessRacesinOrbit I've never before seen the "data" being used as plural to be honest, and even you accept that its "usage is in decline", so why wouldn't we use the more widespread version? I'm pretty sure it's only a matter of time that someone else will suggest the same edit. :)
a08a6cd52cad9b3466cb149609b7e2cd16674eba200206ebc1ca86dcc4754131
['c42d1feead104448ade1a97515519b9c']
`> Just also release the key.` Who guarantees that the published key haven't been modified by <PERSON> after publishing? She could publish it in the first place and <PERSON> can be unaware of the fact that some key is published somewhere at all as "his" key. That's why people have key signing parties, where people usually exchange their public keys, most of the time even written/printed on paper (see https://security.stackexchange.com/questions/126533/why-shouldnt-i-bring-a-computer-to-a-key-signing-party)
266d09895c05fbd7bf16027ba9b2eac360bf9fb12d25568b5881010bdcd5d3d7
['c4364a0fb8c9465ea4c98e07fae9720d']
I'm trying to figure out how to use elasticsearch to index and search a bunch of lists. My current set-up is as follows: var item1 = { "title" : "The Great Gatsby" }; var item2 = { "title" : "Ender's game" } var item3 = { "title" : "The name of the wind" } var itemList1 = [item1, item2]; var itemList2 = [item2, item3]; var itemList3 = [item3, item1]; Is there a way to index my lists? Cause an item can belong to multiple lists and has no reference to what lists it belongs. The ultimate goal is to find items with the word "great" in its title in itemList3.
d01f40552f8b00deedc1f383daa3327219b86c6782ad616cb28cf6c63517e651
['c4364a0fb8c9465ea4c98e07fae9720d']
We use the blueprintjs library heavily, including the Dialogs. The problem happens when we use React-intl library to translate strings in our dialogs. The react-intl library passes some data through the react context object. https://github.com/yahoo/react-intl/blob/4c7a766ec59f3fdceb5f0079359ca3919a23c5e3/src/components/message.js#L59 That means, if we change the context, all our UI changes, except for Popover and Dialogs. I suspect this is because the context does not update. Any workarounds / thoughts?
089e30358724eb109356aed361900d59a72bf9e213972b97c9d8243216d9bd1c
['c441a25834514b1581a4edbfd2d73793']
I've created a MVC 4, validation attribute that will compare 2 fields, that represent a year range, to validate that the end year is not before the start year. I've created the following JS: jQuery.validator.unobtrusive.adapters.add( 'yearrange', ['startyear', 'endyear'], function (options) { options.rules['yearrange'] = options.params; options.messages['yearrange'] = options.message; } ); jQuery.validator.addMethod( 'yearrange', function (value, element, params) { var startYearElementName = params.startyear; var endYearElementName = params.endyear; var startYear = $('#' + startYearElementName).val(); var endYear = $('#' + endYearElementName).val(); if (startYear == '' || endYear == '') { return true; } return (+startYear <= +endYear); }, ''); I'm applying the validation attribute to both properties in my ViewModel: [YearRange("StartYear", "EndYear", "yearRangeInvalid")] public int StartYear { get; set; } [YearRange("StartYear", "EndYear", "yearRangeInvalid")] public int EndYear { get; set; } I don't want to use a summary validation message. Can I use validation groups to trigger the re-validation of both fields when one is changed? And can it be configured in the adapters.add callback above? I unsuccessfully tried something like: jQuery.validator.unobtrusive.adapters.add( 'yearrange', ['startyear', 'endyear'], function (options) { options.rules['yearrange'] = options.params; options.messages['yearrange'] = options.message; jQuery.validator.groups[options.params.startyear] = "yearrange"; jQuery.validator.groups[options.params.endyear] = "yearrange"; } );
46e4f07416c2423e597efc0e3a03810baae6d48f6f5fbfbd20c4948b4e43ee54
['c441a25834514b1581a4edbfd2d73793']
My example: class BoxVM { int BoxId {get;set;} List<ItemVM> Items {get;set;} } class Box { int BoxId {get;set;} List<Item> Items {get;set;} } With mapping config: CreateMap<BoxVM, Box>(); CreateMap<ItemVM, Item>().ConvertUsing<ItemTypeConverter>(); When converting BoxVM will Items, the ItemTypeConverter is not called. Leaving an empty Items collection in Box. The BoxId is being mapped correctly. Am I missing a step?
980fe14b0e9c41dff3e39e76a156a00d06592c7b01e4d19c220da079324e97e6
['c450ed51cde648159fc5390911d6abbe']
I'm using Google Web Fonts API in my WordPress theme and stumbled upon a weird problem: fonts don't load in FF4 or IE9 (it's fine in Safari, Chrome, Opera, and IE8...). I checked the source of the page, as well as the PHP code that creates the links to Google Fonts stylesheets and everything works fine - the links are created: <link rel='stylesheet' id='webfont-body-css' href='http://fonts.googleapis.com/css?family=PT+Sans&#038;ver=3.1.2' type='text/css' media='all' /> <link rel='stylesheet' id='webfont-head-css' href='http://fonts.googleapis.com/css?family=Gruppo&#038;ver=3.1.2' type='text/css' media='all' /> and the styles are applied as well: <style type='text/css'> body, input, textarea { font-family: 'PT Sans', 'Helvetica Neue' Arial, sans-serif; } h1, h2, h3, h4, h5, h6 { font-family: 'Gruppo', 'Helvetica Neue' Arial, sans-serif; letter-spacing: normal; } </style> It works fine in other browsers, but FF4 and IE9 have a problem with it and completely ignore the Google Fonts. Here's the link to the site/theme in question: http://dev.gentlecode.net/agency
9a39db286b7e67e8b733ec890a3ecadf0164a32f3a3e57f52a5939e5443e41da
['c450ed51cde648159fc5390911d6abbe']
I'm trying to include a simple contact form in a WordPress theme I'm coding for someone (they want it functional without using any WP plugins, so I'm simply using PHP). Here's the code I'm using: <?php include "../../../../wp-blog-header.php"; // include WP to be able to use some options if (of_get_option('ss_contact_email', 'no entry' )) { // custom WP option $mailto = of_get_option('ss_contact_email', 'no entry' ); } else { $mailto = get_option('admin_email'); // WP option to get email address of the admin }; $cc = ""; $bcc = ""; $subject = "[Contact Form] " .$_POST['subject']. ""; $vname = ucwords($_POST['user']); $email = $_POST['email']; function validateEmail($email) { if(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2,3})?(\.[a-zA-Z]{2,3})?$', $email)) return true; else return false; } if((strlen($_POST['user']) < 1 ) || (strlen($email) < 1 ) || (strlen($_POST['question']) < 1 ) || validateEmail($email) == FALSE){ $emailerror .= ''; if(strlen($_POST['user']) < 1 ){ $emailerror .= '<span class="wrong">Please enter your name. </span>'; } if(validateEmail($email) == FALSE || strlen($email) < 1 ) { $emailerror .= '<span class="wrong">Please enter a valid e-mail address. </span>'; } if(strlen($_POST['message']) < 1 ){ $emailerror .= '<span class="wrong">Please enter your message. </span>'; } } else { $emailerror .= "<span>Your message has been sent. Thank you!</span>"; // NOW SEND THE ENQUIRY $timestamp = date("F j, Y, g:ia"); $messageproper ="\n\n" . "Name: " . ucwords($_POST['user']) . "\n" . "Email: " . $email . "\n" . "Website: " . $_POST['url'] . "\n" . "Subject: " . $_POST['subject'] . "\n" . "Comments: " . "\n" . $_POST['message'] . "\n" . "\n\n" ; $messageproper = trim(stripslashes($messageproper)); mail($mailto, $subject, $messageproper, "From: \"$vname\" <".$_POST['email'].">\nReply-To: \"".ucwords($_POST['user'])."\" <".$_POST['email'].">\nX-Mailer: PHP/" . phpversion() ); } ?> <?php echo $emailerror; ?> Error handling seems fine, it returns all the correct errors but if all fields are correct it goes blank instead of sending and displaying the "Thank you.." message. I've used the same script on the same server numerous times, and never had any problems with it but this time I stumbled upon an issue - the mail isn't getting send, even though it doesn't return any errors. I'm not sure what goes wrong. Anyone able to skim through the code and look for some obvious mistakes?
58f4c1b954b61fe624d45359814f4d49809887b628196b13c1ac0aaf2454cd5a
['c45cbffec2004629a2e1c82b7598a3d9']
La mejor manera de hacer lo que pretendes es evaluando con isset() primeramente si lo que le llega por $_POST existe y de ser así se le aplica el valor que llega. Al inicializar las variables como cadena vacía en caso de que no llegue por $_POST no se te a a imprimir en la cadena HTML. PHP $nombre = ''; $telefono = ''; $direccion= ''; $email = ''; if(isset($_POST['nombre'])) { $nombre = $_POST['nombre']; } if(isset($_POST['telefono'])) { $nombre = $_POST['telefono']; } if(isset($_POST['direccion'])) { $nombre = $_POST['direccion']; } if(isset($_POST['email'])) { $nombre = $_POST['email']; } $html = " <div class='cliente'> $nombre <br> $telefono; <br> $direccion; <br> $email; </div> ";
c44584065421751222c9c7d1abe935b18e4f344afc55953c34bb17cce5ed6624
['c45cbffec2004629a2e1c82b7598a3d9']
La manera a la que estamos acostumbrados a usar los selectores CSS es esta: CSS .elemento1 .elemento2 .elemento3. { /*reglas css*/ } De esta manera lo que dices es que busque un elemento con la clase elemento3 que sea hijo de un elemento con la clase elemento2 y que este a su vez sea hijo de un elemento con la clase elemento1. Pero existe una manera para referirte al mismo elemento con varias clases y es tan simple como quitarle el espacio entre clases quedando así: CSS .elemento1.elemento2.elemento3. { /*reglas css*/ }
1ec36ffdcef70d6d08963860d0dc27e19ed00923d4ca5d9114b55de9504c67c7
['c466c01efef94d9ba1f49c27d860979d']
Thanks <PERSON> for putting me on right direction. This is current working CMakeLists.txt: # CMakeList.txt : Top-level CMake project file, do global configuration # and include sub-projects here. # cmake_minimum_required (VERSION 3.8) project ("MyOPC") add_executable (${PROJECT_NAME} "MyOPC.cpp" "MyOPC.h") # ----------------------------------- # open62541 specific settings - BEGIN # ----------------------------------- set(UA_ENABLE_AMALGAMATION ON CACHE BOOL "" FORCE) set(UA_LOGLEVEL 300) add_subdirectory ("open62541") set_source_files_properties("${PROJECT_BINARY_DIR}/open62541/open62541.c" PROPERTIES GENERATED TRUE) set(${PROJECT_NAME}_SRCS ${${PROJECT_NAME}_SRCS} "${PROJECT_BINARY_DIR}/open62541/open62541.c") include_directories("${PROJECT_BINARY_DIR}/open62541/") # ----------------------------------- # open62541 specific settings - END # ----------------------------------- add_dependencies(${PROJECT_NAME} open62541 open62541-amalgamation-source open62541-amalgamation-header) target_link_libraries(${PROJECT_NAME} open62541) Reference in header file MyOPC.h: #include "open62541.h"
229fa31c0a0c484972eab92927b7d0da6746afd365da58fd861d0d48d87c7f7d
['c466c01efef94d9ba1f49c27d860979d']
You can check DinkToPdf library. It is a wrapper around wkhtmltopdf library for .NET Core. Synchronized converter Use this converter in multi threaded applications and web servers. Conversion tasks are saved to blocking collection and executed on a single thread. var converter = new SynchronizedConverter(new PdfTools()); Define document to convert var doc = new HtmlToPdfDocument() { GlobalSettings = { ColorMode = ColorMode.Color, Orientation = Orientation.Landscape, PaperSize = PaperKind.A4Plus, }, Objects = { new ObjectSettings() { PagesCount = true, HtmlContent = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In consectetur mauris eget ultrices iaculis. Ut odio viverra, molestie lectus nec, venenatis turpis.", WebSettings = { DefaultEncoding = "utf-8" }, HeaderSettings = { FontSize = 9, Right = "Page [page] of [toPage]", Line = true, Spacing = 2.812 } } } };
e47a19c6ed6808fca61592e549b3abf1e7ea14918040f21832dcb88284a8871c
['c47196c54c234846906c27ae5b03d226']
есть клиент серверное приложение на wpf c# с использованием Entity Framework и Sql Server, нужно зашифровать данные с помощью sql server ( да там есть выбор даже зашифровать столбец,это все хорошо) Не знаю, что нужно прописать в вижуал студио (( Нигде не могу найти ответ. Тем более половина нужного итак прописывается Entity Framework. Что нужно прописать в вижуал, чтоб корректно совершалась работа с данными после шифрования?
538c4621792958e7dd162fbea8b2b46dd0107a66e5b4b985b8d08250a7be302e
['c47196c54c234846906c27ae5b03d226']
unfortunately I've raised the question of "why" and was given nothing in return, or was given abstract reasons that I didn't agree applied to the situation. I do like that you have pointed out these are often happening because of other real concerns like growing teams, I may just have to accept that they know something I don't -- or that they are simply wasting our time. Appreciate the input.
8477a777265e780dbb5ac504779e061e95afbc139e751dd6d8915a4b2d74c1ef
['c491f6ec59294ef2ba0276f9271d178d']
@hvd There are (at least) two literal meanings. There's the one based on the original, ethnic, meaning of the word "nation", where a nation is, essentially, a people, whence terms such as "nationalist" and "nation-state" are derived, and then there's the newer meaning, where a "nation" is essentially a sovereign state.
92773f43d4bdf8d6f24930bb5813fbd8cf96938188e53718342eca07caa04cd0
['c491f6ec59294ef2ba0276f9271d178d']
by ways of contradiction assume $f$ is not constant . $f$ is continuous on a closed and bounded interval then $f$ has absolute max and min .i.e.$\exists$ $x_0,y_0 \in [0,1]$ such that $f(x_0)\le f(x) \le f(y_0)$ $\forall x \in [0,1]$ from assumption $f(x_0)\ne f(y_0)$ and $f(x_0),f(y_0)$ are rational value (from question) by density theorem $\exists$ $r \in Q' $ such that $f(x_0)<r<f(y_0)$ then by intermediate value theorem $\exists c \in [0,1]$ such that $f(c)=r$ which contradicts with f has only rational value therefore $f$ is constant.
44d6fb0ed3b6a96084e863207cecdf60d589fe3ba4e3d1c96d116f0059ec7a2c
['c492ee79481c4c728ef634e7fd6b96b6']
As <PERSON> has pointed out, the word was not borrowed into English from Latin, so no, there is no credence to any argument that involves Latin. (Whether or not it actually got Latinized, I don't know, as I don't speak Latin. Many words have indeed been borrowed into Latin long after it expired. From what I hear there are international committees that agree on what new Latin words should look and behave like. It might well be that *emoji* is among those words, or about to join them. However, since English has borrowed the word straight from Japanese, all of that is irrelevant.)
fa2b0add5284ff53ea7465193c78d151e334fc2a528908a4f5599da39b079ac0
['c492ee79481c4c728ef634e7fd6b96b6']
"Where are you going to" seems to be quite popular among foreign learners whose mother tongue is German. That's probably because in German, "Where are you going" (*wo gehen Sie*) would be wrong, the correct form being *wo gehen Sie hin*. So those people try to mimic that *hin* in English by adding a *to* (though, of course, technically *hin* is not a preposition, but rather a part of the split-up interrogative *wohin*, "'where' as an indication of direction", as opposed to a simple *wo*, "'where' as an indication of position, with no indication of direction").
195072b4678847319004c519769d367696935e0754e26e04532bc62f69b1496c
['c494437c2f1b4001a85edbc7762e7688']
For a quick and dirty question, you'll get quick and dirty answer: private void duplicateTab() { // Your TabControl Name TabPage selectedTab = tabControl1.SelectedTab; TabPage newTab = new TabPage(); foreach (Control ctrl in selectedTab.Controls) { Control newCtrl = (Control)Activator.CreateInstance(ctrl.GetType()); PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(ctrl); foreach (PropertyDescriptor proDe in pdc) { object val = proDe.GetValue(ctrl); proDe.SetValue(newCtrl, val); } newTab.Text = "New Tab"; newTab.Controls.Add(newCtrl); } tabControl1.TabPages.Add(newTab); }
a2824971dbe39b496a439fabc4bce2ad894e574cff4f19b2717259fce1d52740
['c494437c2f1b4001a85edbc7762e7688']
I have a static html <table> like this which I cannot modify: <table> <tr> <td>Street\Art</td> <td>Start</td> <td>10.06.2014 21:59:40</td> <td>10.06.2014 22:00:29</td> <td><IP_ADDRESS>.0</td> </tr> <tr> <td>Street\Art</td> <td>Updated</td> <td>KABIT</td> <td>10.06.2014 22:00:44</td> <td><IP_ADDRESS>.0</td> </tr> <tr> <td>Street\Art</td> <td>Down</td> <td>10.06.2014 22:02:54</td> <td>10.06.2014 22:03:43</td> <td><IP_ADDRESS>.0</td> </tr> <tr> <td>Cloud\Art</td> <td>Start</td> <td>11.06.2014 18:23:42</td> <td>11.06.2014 18:24:38</td> <td><IP_ADDRESS>.1</td> </tr> <tr> <td>Cloud\Art</td> <td>Updated</td> <td>JEL_EM</td> <td>11.06.2014 18:25:30</td> <td><IP_ADDRESS>.1</td> </tr> <tr> <td>Cloud\Art</td> <td>Updated</td> <td>JEL_EM</td> <td>12.06.2014 06:00:12</td> <td><IP_ADDRESS>.1</td> </tr> </table> I'd like to convert the fourth <td> in elapsed time. eg: <tr> <td>Street\Art</td> <td>Start</td> <td>10.06.2014 21:59:40</td> <td>10.06.2014 22:00:29 - 20 minutes ago</td> <td><IP_ADDRESS>.0</td> </tr> or if its better: <tr> <td>Street\Art</td> <td>Start</td> <td>10.06.2014 21:59:40</td> <td>10.06.2014 22:00:29</td> <td>20 minutes ago</td> <td><IP_ADDRESS><PHONE_NUMBER>:00:12</td> <td>1.1.1.1.1</td> </tr> </table> I'd like to convert the fourth <td> in elapsed time. eg: <tr> <td>Street\Art</td> <td>Start</td> <td>10.06.2014 21:59:40</td> <td>10.06.2014 22:00:29 - 20 minutes ago</td> <td>0.0.0.0.0</td> </tr> or if its better: <tr> <td>Street\Art</td> <td>Start</td> <td>10.06.2014 21:59:40</td> <td>10.06.2014 22:00:29</td> <td>20 minutes ago</td> <td>0.0.0.0.0</td> </tr> I have implemented de conversion algorithm, but I need to get the fourth <td> and add the elapsed time. My working JS-Fiddle: http://jsfiddle.net/LinkJoe/5UHuU/
acbebf2be784911a72f5065ec073a4ee759db631321c0a6f5283f331bf068eea
['c49b0a1ca37a4ca6b44b9b3dc5996c21']
SELECT * FROM ( SELECT JSON_ARRAY_ELEMENTS(contract_product_grid::json) AS js2 FROM heaps WHERE 'contract_product_grid' = 'contract_product_grid' ) q WHERE js2->> 'product_name' IN ('<PERSON>', '<PERSON><IP_ADDRESS>json) AS js2 FROM heaps WHERE 'contract_product_grid' = 'contract_product_grid' ) q WHERE js2->> 'product_name' IN ('Axele', 'Bell') As, I mentioned in question that my column name is 'contract_product_grid' and i have to only search from it. Using this query, I'm able to get contract_product_grid information using IN clause with entered product name.
a30fb39bf4ee4c1c3558def308cf3889b52d77836df4657ddbb143bd78d4efa4
['c49b0a1ca37a4ca6b44b9b3dc5996c21']
I can call background jobs in my application by using Sidekiq gem. However, I'm trying to implement a Sidekiq Cron Job, which will run every day at 11 PM. I have implemented the official doc of cron gem but it's not working. Also, I tried whenever gem and still no luck.
5042d2d5d068a43f23244e212963404ee697a472ad32dd48ccfbee2c8e6f222e
['c4a90a6aeb164ef4b75fbb88c9f26151']
OP keeps the order of list1, and masks it with elements from list2. I create a powerset of list2, and extend it with Nones to match the length of list1 (= helper). Then I iterate over unique permutations of helper, masking one array with the other to hide parts of list1 where the mask contains a not-None value. Powerset from: How to get all subsets of a set? (powerset) from itertools import chain, combinations, permutations def powerset(iterable): "powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)" s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1)) list1 = [1, 2, 3] list2 = [4, 5] solutions = [] for s in powerset(list2): # for every possibility of list2 helper = [None] * (len(list1) - len(s)) helper.extend(s) # create something like [None, None, 4] for perm in set(permutations(helper, len(helper))): # for each permutation of the helper, mask out nones solution = [] for listchar, helperchar in zip(list1, perm): if helperchar != None: solution.append(helperchar) else: solution.append(listchar) solutions.append(solution) print(solutions) # [[1, 2, 3], [4, 2, 3], [1, 4, 3], [1, 2, 4], [1, 2, 5], [5, 2, 3], [1, 5, 3], [1, 5, 4], [4, 2, 5], [5, 2, 4], [5, 4, 3], [1, 4, 5], [4, 5, 3]]
2de1e6361ef3135b23308c8fbf50da667a336e6cf7e251f8be56074c1db8b4a3
['c4a90a6aeb164ef4b75fbb88c9f26151']
You should use re.findall to find each occurrence. You can fine-tune the selection though, as you are selecting the whitespaces after Error and after the error code. See the output array. import re mainString = "Error hasdashdkashdaskhdkha status:400 \n\t Error asdasdasdasdasdas status 404 \n\t" start = re.escape("Error") end = re.escape("\n\t") result = re.findall('%s(.*)%s' % (start, end), mainString) >>> result [' hasdashdkashdaskhdkha status:400 ', ' asdasdasdasdasdas status 404 ']
17b006becca534f1bb64cf279161365f94a8674cb5805837d2e573cd0c99f012
['c4c2d7a11dec430abb0e42623ac1618e']
According to Telerik this is not possible, and that's correct, you can't stop the user "selecting" multiple entries, you can however prevent multiple entries from being "stored" so when the user exists the auto complete field I remove all entries in the autocomplete box - except the first entered (and train the users) like so. private void stripmultientries() { // remove multi entries in the stock cat box ??? - leaver only the first string fulltext = radAutoCompleteBox1.Text; // remove everything after the first semi colon // int index = fulltext.IndexOf(";"); if (index > 0) { fulltext = fulltext.Substring(0, index); } radAutoCompleteBox1.Text = fulltext; } This method can be called when saving the form or when exiting the autocomplete control
b4c6c97020f4dfff59312553c34596623d7cccbb7ab957d5725a853df43493a2
['c4c2d7a11dec430abb0e42623ac1618e']
The error i am getting is as follows System.ArgumentException: 'Unable to get file location. This most likely means that the file provider information is not set in your Android Manifest file. I have gone through all the suggestions i can find regarding permissions for fileprovider to no avail The code where it is failing is.. var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions { Directory = "", SaveToAlbum = true }); (I have tried setting "Directory" to "images", "pictures" and just about anything else you can think of ! resources/file_paths.xml is... <?xml version="1.0" encoding="utf-8" ?> <paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-files-path name="my_images" path="Pictures" /> <external-files-path name="my_movies" path="Movies" /> </paths> My AndroidManifest .xml is ... <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.app1" android:installLocation="auto"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> <application android:label="App1.Android" android:icon="@drawable/Woodstonelogo"></application> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <application android:label="App1.Android"> <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data> </provider> </application> </manifest>
2178f45f79a6919e0d1056f644e221e73a8443edc3838045159c16b198ab608f
['c4c75f10f4774534a45a095010a969cb']
# this function will not stop untill no exception trown in the try block , it will stop when no exception thrown and return the value def get() : i = 0 while (i == 0 ) : try: print("enter a digit str : ") a = raw_input() d = int(a) except: print 'Some error.... :( ' else: print 'Everything OK' i = 1 return d print(get())
4b7444c9aedddf5114767dcdd2da9b6b4559dd9a95e156640d25eafb68a2c668
['c4c75f10f4774534a45a095010a969cb']
You can run any script wriiten in text editor of blender and debuging it in the python console of blender and here is how : 1.create your script file and put there your code . open the console python in the blender and type in it : bpy.data.texts[INDEX_OF_YOUR_FILE].as_module() . INDEX_OF_YOUR_FILE is the index of your file in the drop down menu of list of text in text editor .
6c79fed5600b910b79c1d19f53a4aa3a832acb6cb8ce77207e4e7c7fb11cf6c7
['c4ca74f38b7146a9a008fce6364cbd28']
While I don't know the internal workings of any of the aforementioned services, I'd guess that they download/create a local copy of the images and generate a thumbnail from that. Imgur, as an image hosting service, definitely needs a copy of the image prior to being able to generate thumbnails or anything else from it. The image may be stored locally or just in memory, but either way, it must be downloaded. The search engines displaying screenshots of the sites likely have services that periodically take a screenshot of the viewable area when the content is getting indexed, and then serve those screenshots (or derivatives) along with the search results. Taking a screenshot really isn't dangerous, so there's nothing to worry about there, and whatever tools are used to load/parse/index the websites will obviously be written with security considerations in mind. Of course, there are security concerns about the data you're downloading, too; the images can easily contain executable code (such as PHP) in their EXIF data, so you need to be careful about what you do with the images and how.
21ad6a07c648b5764369426878f4d2bb68f9ddd51b774a3455c95f44534aa5ac
['c4ca74f38b7146a9a008fce6364cbd28']
Create a mapping array just like you said. This doesn't sound like something where performance is critical, so there's absolutely no need to go out of your way to create something 'clever.' Use a solution that is clear and simple to understand, because not only will it be easier to debug when things go wrong, but one fine day you (or someone else) will need to come back and make sense of your code, and that'll be a heck of a lot easier without the unnecessarily clever bits.
eb3fbbf83a6bfe44ad59edc8074f5a6ccfff3cde86b62327bc1c75b3b5297fb0
['c4cd74b03f2941f5bb2bc8309ba9f8d4']
Just for heads up. I had this issue today and eventually I simply noticed that I simply placed the entries in the wrong .plist file. If you filter your project files (down to the left) type in .plist and you might see two files. one is the tests' and the other is the one you actually need to set up. Good luck!
99bb8f2bd7d2e90f930917629dfe4b189013cc826328ff13f91e046ee479902b
['c4cd74b03f2941f5bb2bc8309ba9f8d4']
I am going to need to have encrypted messages between my app and my server. I was going through apple's documentation to find something about that issue. (basically I need to encrypt the way the communication is going on so that no other app can imitate that and use my server) Does anyone know if this can pose a problem with Apple?
0f1fad5aca452abe908a0e1a993c8db4a93cca2d5b1dc316881eea4b6562766d
['c4d509280fb24caeafe4a6899b405797']
the most important part is Control which control in html tags you want to register the script for example if you have user control and you want to run the script just for that use this line ScriptManager.RegisterStartupScript(this, this.GetType(), "alertscript", "document.getElementById('userControl_h1TAG')", true); but when you want to register the block and script to all part of that page use this line in CS code of user-control : ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertscript", "document.getElementById('page_h1TAG')", true);
e4563d8396999c16f20141cc91eae9ca453dcb5b9fe380a4f6088c8ae41733ab
['c4d509280fb24caeafe4a6899b405797']
if you use Master page for your aspx pages you can access your page GridView in your user control in this way Page mypage= this.Page; GridView mypageGridview = (GridView)mypage.Master.FindControl("ContentPlaceHolder1").FindControl("YourGridView"); if you have not master page Page mypage= this.Page; GridView mypageGridview = (GridView)mypage.FindControl("YourGridView");
0b03fd1d0c858a2e2536ec93cf5b1a1f33e50a83bc3b751cf95ba5c8fc7e4b53
['c4e5b9e19feb4fe888cb61677871f607']
SystemStack.ts import { PianoMenu, DEFAULT_MENU } from "@/core/ui/menu/PianoMenu"; export interface SystemStack { piano: PianoMenu; startWork: Date; } export class DefaultSystemStack implements SystemStack { piano: PianoMenu = DEFAULT_MENU; startWork: Date = new Date(); } This is system information. Stack storage import { Module } from "vuex"; import { RootState } from "@/core/store/Types"; import { SystemStack, DefaultSystemStack } from "@/core/system/SystemStack"; import { getters } from "./getters"; import { actions } from "./actions"; import { mutations } from "./mutations"; export const state: SystemStack = new DefaultSystemStack(); const namespaced = true; export const systemStack: Module<SystemStack, RootState> = { namespaced, state, getters, actions, mutations }; Stack storage. Actions import { ActionTree } from "vuex"; import { RootState } from "@/core/store/Types"; import { SystemStack } from "@/core/system/SystemStack"; import { MenuGroup } from "@/core/ui/menu/PianoMenu"; export const actions: ActionTree<SystemStack, RootState> = { initSystemStack({ commit }, newStack: SystemStack): any { commit("initializeSystemStack", newStack); }, addMenuGroup({ commit }, menuGroup: MenuGroup): any { commit("configStackAddMenuGroup", menuGroup); } }; Stack storage. Mutations import { SystemStack } from "@/core/system/SystemStack"; import { MenuGroup } from "@/core/ui/menu/PianoMenu"; export const mutations: MutationTree<SystemStack> = { initializeSystemStack(state, newStack: SystemStack) { state = newStack; }, configStackAddMenuGroup(state, menuGroup: MenuGroup) { state.piano.addGroup(menuGroup); } }; In App.vue I used method mounted. In the method, I initialize the stack and add my menu items. export default class App extends Vue { @ProcessAction executeProcess: any; @SystemStackAction addMenuGroup: any; @SystemStackAction initSystemStack: any; @JournalAction addInfoEvent?: any; drawer = true; menu = false; empty = [0]; mounted() { this.initSystemStack(new DefaultSystemStack()); this.addMenuGroup(GROUP_CUSTOM_MENU); } } And now, after the initialization of the stack, I have a default stack with the default menu, but if I try to add new menu items, I get an undefined value, because the stack does not have the piano parameter in the store. I watched piano after the stack was initialized, and this parameter was. Help me to understand filled
330fc1c56c9fd9eb35ffbf2555c0de2a49455ff19bdd584a32a266802ab7e96a
['c4e5b9e19feb4fe888cb61677871f607']
I made a mistake. I have corrected Remittance @Entity @Table(name = "REMITTANCE") public class Remittance implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "REMITTANCE_ID") private Long id; @ManyToOne(optional = false) @JoinColumn(name = "EXPENSE_ID") private Expense from; @ManyToOne(optional = false) @JoinColumn(name = "EXPENSE_ID") private Expense to; } Expense @Entity @Table(name = "EXPENSE") public class Expense implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "EXPENSE_ID") private Long id; } but now out Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: ru.make.alex.web.model.revenue.Remittance column: EXPENSE_ID (should be mapped with insert="false" update="false")
a252f997f36089d574071dbad50e7e9b6735b014c04aba02911a0ddf7dafd1a2
['c4eaacfb67d9476fb92c6caad1abd5e0']
It's possible to change render arrays using preprocess functions, but in your case it's not a good idea. Link you are talking about is a result of rendering of field formatter. So, you just need another field formatter for your 'Type' field, instead of current 'Label' formatter. Creating new formatter is quite easy(especially if you use EntityReferenceLabelFormatter as an example). Suppose you have a module called entity_reference_link_formatter. Then in the directory of this module create src/Plugin/Field/FieldFormatter folder and put there the following EntityReferenceLinkFormatter.php file: <?php /** * @file * Contains Drupal\entity_reference_link_formatter\Plugin\Field\FieldFormatter\EntityReferenceLinkFormatter */ namespace Drupal\entity_reference_link_formatter\Plugin\Field\FieldFormatter; use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase; use Drupal\Core\Form\FormStateInterface; /** * Plugin implementation of the 'entity reference link' formatter. * * @FieldFormatter( * id = "entity_reference_link", * label = @Translation("Link"), * description = @Translation("Display the link to the referenced entity."), * field_types = { * "entity_reference" * } * ) */ class EntityReferenceLinkFormatter extends EntityReferenceFormatterBase { /** * {@inheritdoc} */ public static function defaultSettings() { return [ 'text' => 'View', ] + parent<IP_ADDRESS>defaultSettings(); } /** * {@inheritdoc} */ public function settingsForm(array $form, FormStateInterface $form_state) { $elements['text'] = [ '#title' => t('Text of the link to the referenced entity'), '#type' => 'textfield', '#required' => true, '#default_value' => $this->getSetting('text'), ]; return $elements; } /** * {@inheritdoc} */ public function settingsSummary() { $summary = []; $summary[] = t('Link text: @text', ['@text' => $this->getSetting('text')]); return $summary; } /** * {@inheritdoc} */ public function viewElements(FieldItemListInterface $items, $langcode) { $elements = array(); foreach ($this->getEntitiesToView($items, $langcode) as $delta => $entity) { if (!$entity->isNew()) { try { $uri = $entity->urlInfo(); $elements[$delta] = [ '#type' => 'link', '#title' => t('!text', ['!text' => $this->getSetting('text')]), '#url' => $uri, '#options' => $uri->getOptions(), ]; if (!empty($items[$delta]->_attributes)) { $elements[$delta]['#options'] += array('attributes' => array()); $elements[$delta]['#options']['attributes'] += $items[$delta]->_attributes; // Unset field item attributes since they have been included in the // formatter output and shouldn't be rendered in the field template. unset($items[$delta]->_attributes); } } catch (UndefinedLinkTemplateException $e) { // This exception is thrown by \Drupal\Core\Entity\Entity<IP_ADDRESS>urlInfo() // and it means that the entity type doesn't have a link template nor // a valid "uri_callback", so don't bother trying to output a link for // the rest of the referenced entities. } } $elements[$delta]['#cache']['tags'] = $entity->getCacheTags(); } return $elements; } } After enabling this module (or after clearing the cache if this module was enabled earlier), you will have 'Link' formatter for all your 'Entity reference' fields, allowing you to customize link text just in the formatter settings.
cec789cee9b0035d1a8ec14988f27e6565c173dbc92ac41ea8bcdff5a60d44c6
['c4eaacfb67d9476fb92c6caad1abd5e0']
It seems your content type has a text field with "Plain text" formatter with "Link to the node" option in "Full" view mode. It tries to build a link to the new node when you preview it, and fails (of course, because node id is required to build a link, but it is not set until you save the node). I don't think there is any reason to have links to current node in "Full" view mode (because such links refer the same node page), so just uncheck "Link to the node" option in your field settings.
ac20292212a0d23a9508c3794a8e244f9ea1033b69ed33757c99ce4e5ce41548
['c50749971b184a7388aac788e2ca05af']
Sometimes the issue just fixes and you well never know how. This is what I did and it is fixed. Goto Tools>> Android >> Android ADB Command Prompt Type C:\Android\SDK>adb remove {your Package Name} Clean Project Build in Release Mode after that clean and rebuild in Debug mode.
92f723b43a6fcbd76dbbd6e4708a21c2f4dec41269f1c7f22bc0c7ba76bb7a00
['c50749971b184a7388aac788e2ca05af']
You can achieve the following procedure with Command Line Process, will help you connect to different databases related to specific files and user credentials. This is Easy with command line (cmd) ssms "C:\Users\Wizard\Documents\SQL Server Management Studio\query.sql" -S ServerAddressOrIP -d Database -U Username -P Passwordhere Copy the following line to (.bat) batch file format and run it.
1a154c24ab5bca7d0975ee8d6e590c2e908dbb2f2da58c04b696a336dc736c9b
['c524e47d8e8f437689cc63d8bb421f0f']
The enumerate() function takes an iterator and returns an enumerator object. This object can be treated like an iterator, and at each iteration it returns a 2-tuple with the tuple's first item the iteration number (by default starting from 0), and the second item the next item from the iterator enumerate() was called on. As quoted from "Programming in Python 3 A Complete Introduction to the Python Language. I'm new to Python and don't really understand what it means from the text above. However, from my understanding from the example code, enumerator object returns a 2-tuple with the index number and the value of the iterator. Am i right? What is the difference between iterator and enumerator?
ec307f82d711f42189d01b1cf6ad21f75cd40477ab7799a8fba65b6a2e56b0da
['c524e47d8e8f437689cc63d8bb421f0f']
A list should be created using squared bracket [] instead of curly bracket {} used by set and dictionary. For your question you should be able to achieve it using the code snippet as follow for i in list: function(*i) The * operator unpacks the tuple in the list and provides it as parameter for the function
36204e52246b698a10e3343fdfc9861f3440d209e8413a12d499f9cf7b97db33
['c52bf1942c21442c9b6893f1bec17c12']
I want to record 5/10 seconds of audio using an electret microphone and an STM32 nucleo development board and send it to my computer in real-time to be processed. I'm a beginner so I'm sure I'm making mistakes, but what limits the data transfer speed for a virtual serial port? I want to sample the audio at 48 kHz, at 12-bits per sample, which by calculation means I need a data transfer rate of 576 kb/s, is that possible via the virtual serial port? if not, is it possible at all with this board? I have the STM32 nucleo-144 development board, I'm using mbed (https://os.mbed.com/platforms/ST-Nucleo-F746ZG/) and a electret microphone circuit (https://docs-emea.rs-online.com/webdocs/00af/0900766b800affa3.pdf)
c32e05904372deea06aec96baca15b0ba147012e71271e99f9fc332ff5b9d8f6
['c52bf1942c21442c9b6893f1bec17c12']
This question might be long, but I want to provide much information. Overview: I'm creating a Stock Quotes Ticker app for Blackberry. But I'm having problems with my StringBuffer that contains an individual Stock information. Process: My app connects to our server via SocketConnection. The server sends out a formatted set of strings that contains the latest Stock trade. So whenever a new trade happens, the server will send out an individual Stock Quote of that trade. Through an InputStream I am able to read that information and place each character in a StringBuffer that is referenced by Threads. By parsing based on char3 I am able to determine a set of stock quote/information. char1 - to separate data char3 - means end of a stock quote/information sample stock quote format sent out by our server: stock_quote_name(char 1)some_data(char1)some_data(char1)(char3) My app then parses that stock quote to compare certain data and formats it how it will look like when displayed in the screen. When trades happen gradually(slow) the app works perfectly. However.. Problem: When trades happen too quickly and almost at the same time, My app is not able to handle the information sent efficiently. The StringBuffer has its contents combined with the next trade. Meaning Two stock information in one StringBuffer. field should be: Stock_quote_name some_data some_data sample of what's happening: Stock_quote_name some_data some_dataStock_quote_name some_data some_data here's my code for this part: while (-1 != (data = is.read())) { sb.append((char)data); while(3 != (data = is.read())) { sb.append((char)data); } UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { try { synchronized(UiApplication.getEventLock()) { SetStringBuffer(sb); DisplayStringBuffer(); RefreshStringBuffer(); } } catch (Exception e) { System.out.println("Error in setting stringbuffer: " + e.toString()); } } }); } public synchronized void DisplayStringBuffer() { try { //parse sb - string buffer ...... } catch(Exception ex) { System.out.println("error in DisplayStringBuffer(): " + ex.toString()); } } public synchronized void SetStringBuffer(StringBuffer dataBuffer) { this.sb =dataBuffer; System.out.println(sb); } public synchronized void RefreshStringBuffer() { this.sb.delete(0, this.sb.length()); } From what I can see, when trades happen very fast, The StringBuffer is not refreshed immediately and still has the contents of the previous trade, when i try to put new data. My Question is: Do you guys have any suggestion on how i can put data into the StringBuffer, without the next information being appended to the first content
4bad446b2576754d878159451460ff09419f6da7dcb75d10837113eceaafc2b3
['c532d9299f5e46f68b192e43b28f88f1']
Okay, so I have a page that builds a table base on a mySQL table using php: tables.php $page .='<form method="POST" action="processing.php">'; $page .= "<table> \n"; $page .= "<tr>\n"; $page .= "<th>ID</th> \n <th>First Name</th> \n <th>Last Name</th> \n <th>PhoneNumber</th> \n <th>Email</th> \n"; //Loops through each contact, displaying information in a table according to login status $sql2="SELECT cID, firstName, lastName, phoneNum, email FROM Contact WHERE oID=".$_GET['orgID']; $result2=mysql_query($sql2, $connection) or die($sql1); while($row2 = mysql_fetch_object($result2)) { $page .= "<tr>\n"; $page .= "<td>".$row2->cID."</td>\n"; $page .= "<td>".$row2->firstName."</td>\n"; $page .= "<td>".$row2->lastName."</td>\n"; $page .= "<td>".$row2->phoneNum."</td>\n"; $page .= "<td>".$row2->email."</td>\n"; //Will only display these buttons if logged in $page .= '<td><input type="checkbox" name="checkedItem[]" value="'.$row2->cID.'"></input></td>'."\n"; $page .= "<td>".makeLink("addEditContact.php?cID=".$row2->cID, "Edit")."</td>\n"; $page .="</tr>"; } $page .= "</table>"; //Two buttons sending to processing.php to decide what to do with selected values from there $page .= '<input name="addToContacts" type="submit" value="Add Selected Contacts To Contact List" />'."\n" ; $page .= '<input name="deleteContacts" type="submit" value="Delete Selected Contacts" />'."\n"; $page .= "</form>\n"; mysql_close($connection); So base on the checkboxes, I can choose to add contacts to another table, or delete contacts off of this table by first sending the information of this form into a processing.php page that decides which button was click and redirects to the proper php script: processing.php: if(!empty($_POST['checkedItem'])) { //Because addToContacts and deleteContacts take in GET instead of POST for convinience, it needs to take all of checkItems and implode it $var=$_POST['checkedItem']; ksort($var); $joinedString= implode(',',$var); //Since there are two buttons in orgDetail, it checks for which was pushed and sends it to the correct page if(!empty($_POST['addToContacts'])) { header('Location: addToContacts.php?cID='.$joinedString); } else if($_POST['deleteContacts']) { header('Location: deleteContacts.php?cID='.$joinedString); } } else { //Error for not selecting any items $page .= makeP("You have not checked off any items. Please click ".makeLink( $currentPage, "here")." to return to previous page"); } And since I am only interested in the delete contact case right now. Here is deleteContacts.php $explodedString=explode(',',$_GET['cID']); foreach($explodedString as $eString) { $sql1="DELETE FROM Contact WHERE cID='".$eString."'"; mysql_query($sql1, $connection) or die($sql1); } header('Location: '. $currentPage); So from here is where it gets complicated. This works fine when I want the page to work synchronously. It bounces around php scripts and all is well. What if I want to delete directly from tables.php using jquery. So what I mean is that, it will run the mysql query to delete the entries from the actual db, and as well after it does that update the table view in tables.php to reflect that change; all done asynchronously? (Please ignore the fact that all the sql queries aren't escaped strings, I realize that and I'll have to fix that later) Thanks in advance.
00d585a0362414fe598227b577340e13748826358d1a40d5a8a7cb47ba9c4294
['c532d9299f5e46f68b192e43b28f88f1']
So I have this form with a table in a php page: $page .='<form method="POST" action="delete.php" ID="orgForm">'; $page .= "<table> \n"; $page .= "<tr>\n"; //Decides what to display based on logged in. Only if logged in can you see all the contact's info $page .= "<th>ID</th> \n <th>First Name</th> \n <th>Last Name</th> \n <th>Phone Number</th> \n <th>Email</th> \n"; //Loops through each contact, displaying information in a table according to login status $sql2="SELECT cID, firstName, lastName, phoneNum, email FROM Contact WHERE oID=".$_GET['orgID']; $result2=mysql_query($sql2, $connection) or die($sql1); while($row2 = mysql_fetch_object($result2)) { $page .= "<tr>\n"; $page .= "<td>".$row2->cID."</td>\n"; $page .= "<td>".$row2->firstName."</td>\n"; $page .= "<td>".$row2->lastName."</td>\n"; $page .= "<td>".$row2->phoneNum."</td>\n"; $page .= "<td>".$row2->email."</td>\n"; $page .= '<td><input type="checkbox" name="checkedItem[]" value="'.$row2->cID.'"></input></td>'."\n"; $page .="</tr>"; } $page .= '<input name="deleteContacts" type="submit" value="Delete Selected Contacts" />'."\n"; $page .= "</form>\n"; $page .='<script src="assets/js/orgDetails.js" type="text/javascript"></script>'."\n"; I need to somehow write an jquery script inside orgDetails.js that is able to delete the checked rows when I push delete button. The change have to appear on screen without refresh, and I also need to be able to delete the actual row from the sql db as well. Can someone please give me a hand? Thanks.
ab36d8d52389792c6785365f43a3656ee45f61d39f5b898866566f1cda1f7621
['c53582528df945eda5ae2006aa9f8ec1']
I am very interested if it is possible. Otherwise one simple way to reach that: you could try to generate the entity using the jhipster command jhipster entity <entityName> --[options] see for more details. And customize your application to use multiple databases by following this excellent article: https://www.baeldung.com/spring-data-jpa-multiple-databases
7dbf3caac5fe8ba3160a25035101006626a3017467dc280f2b29e8def10c0a5b
['c53582528df945eda5ae2006aa9f8ec1']
To complete @Mahmoud response you can inject the repository as you did in the first example and the set it to the reader: @Autowired private IRepository repopsitory; @Component public class ABCJobLauncher { @Autowired public JobBuilderFactory jobBuilderFactory; @Autowired public StepBuilderFactory stepBuilderFactory; @Autowired private JobLauncher jobLauncher; public JobExecution startJobBatchProcessing(KeyRotationParameters keyRotationParameters) { JobExecution jobExecution = null; Reader reader = new Reader(); reader.setRepository(repository); // set the repository reader.setKeyRotationParameters(keyRotationParameters); Processor processor = new Processor(); Writer writer = new Writer(); try { Step step1 = stepBuilderFactory.get("step1").<BatchParameters, BatchParameters>chunk(1).reader(reader) .processor(processor).writer(writer).build(); Job jobDetails = jobBuilderFactory.get(JobName).incrementer(new RunIdIncrementer()).flow(step1).end().build(); JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis()) .toJobParameters(); jobExecution = jobLauncher.run(jobDetails, jobParameters); } catch (Exception e) { e.printStackTrace(); } return jobExecution; }
5b161be305a6c6a4c83cf3b715bc00044ebe397cdd18ef85ee87ef90760187e0
['c53d17f205fb45fd8eb11b3b0739dbeb']
I created fiddle for you. First you have to style your bars. Then you need to create function that will add or remove show class in order to display your content. Something like that: const btn = document.querySelector('.dropbtn'); const content = document.querySelector('.content'); btn.addEventListener('click', function() { if(!content.classList.contains('show')) { content.classList.add('show') } else { content.classList.remove('show') } }) Here you have styles: .bar { width:20px; height:3px; background:black; margin: 2px; } .content { width:100px; height:200px; background:gray; display:none; } .content.show { display: block; } https://jsfiddle.net/ajp02uby/
a0ac2993de130a5572c067e5d95695009692575921481c8d53dc594187189dad
['c53d17f205fb45fd8eb11b3b0739dbeb']
please delete these unnecessary br tags and also delete align-items-center class from a row. <div class="container"> <div class="row"> <div class="col-md-8 justify_text"> <span> <h4 class="bold_font color-mwc-orange">WHO WE ARE</h4> <h4 class="color-mwc-blue">My White Card is an innovative collaboration of the recent revolutionary healthcare approach; The first of its kind beauty, health, and wellness membership that offers an array of the best discount coupons and unlimited services in pursuit of a convenient access through a Mobile App technology. </h4> <h4 class="color-mwc-blue">We offer different discount coupons from aesthetics, cosmetic surgeries, dental services, functional medicine, preventive healthcare and wellness programs from our Exclusive, Premiere and carefully curated clinics and excellent doctors in the Metro.</h4> </span> </div> <div class="col-md-4"> <img src="https://via.placeholder.com/350 C/O https://placeholder.com/" class="img-responsive spacer center-block"> </div> </div> </div> Here is a fiddle: https://jsfiddle.net/xp3zqLra/5/
bcf6c757b87ec421e7804dec070a5e274f45be50bdb54f08a7a90047344c8a22
['c547004560d34ba3bcd2d85219223b29']
I am trying to load and index hdfs data in solr 5.1.I stored the data in a hive table and used DIH to import and index. i followed the steps provided in the link Solr DIH. I couldn't see any material on DIH with hive so Wanted to check if anyone have worked on this . Also looking for some suggestions on the above scenario.
a53750c009256e99c5bbae83e9e5094d9a469c14e89177ff2c2d130861324e28
['c547004560d34ba3bcd2d85219223b29']
I understand that you are trying to update the existing records in HDFS whenever there is change happens in the Source MySQL table. You should use --append only when you dont want to update the changed records in source table. Another approach is you can to try to migrate the changed records in a separate directory as delta_records and then join it with the base_records. Please see hortonworks link for more clarity
691289f1ccde3f2a89fda1c8c33d603c8d6d9a8c353ec9ba3dc59c37724c86ac
['c55259179033452fb84e2dd12027de53']
The first argument to the callback function is the error, pass null in case of success. 'use strict' const async = require('async') function api_hit(callback) { setTimeout(() => { console.log('Completed api_hit') callback(null, 'api_hit') }, 1000) } function delay(callback) { setTimeout(() => { console.log('Completed delay') callback(null, 'delay') }, 100) } function mysql_check(callback) { setTimeout(() => { console.log('Completed mysql_check') callback(null, 'mysql_check') }, 500) } var tasklist = [api_hit, delay, mysql_check]; if (tasklist.length > 0) { async.series( tasklist, function (err, response) { console.log(err); console.log(response); } ); } Doc link: https://caolan.github.io/async/docs.html#series
9f2f1345f981280ccf2fa93a8718d506d3adf71e814e8eb50008e17a489a888c
['c55259179033452fb84e2dd12027de53']
Here is the answer 'use strict'; const list = [ { count: 12, Dish: { id: 2, name: 'Дессерт 4' } }, { count: 2, Dish: { id: 1, name: 'Дессерт 4' } }, { count: 3, Dish: { id: 2, name: 'Дессерт 4' } }, { count: 10, Dish: { id: 1, name: 'Дессерт 4' } } ]; console.log('Unsorted ', list); const set = new Set(); list.sort((ele1, ele2) => { if (!set.has(ele1)) { ele1.count += ele1.Dish.id; set.add(ele1); } if (!set.has(ele2)) { ele2.count += ele2.Dish.id; set.add(ele2); } return ele1.Dish.id - ele2.Dish.id; }); console.log('Sorted ', list);
92add2ad33aab0e0a76efeb27e24df93ee7c9bea2eb91a2844b1978f2ef7d80d
['c55a275c10ab4651a55b7ded62cf9179']
From my personal experience, I have to say that we use the first approach (specify job params on JobDetail). The main reason behing this decision is that is seems more simple and clean to understand and maintain. When a user schedules a job with specific parameters, we create a JobDetail with JobDataMap populated accordingly. The Trigger of this scheduled job may be fired many times, and we have to make sure that the parameters won't change and stay the same for all job executions. If a user wants to schedule a job of the same type with different parameters, a new JobDetail is being created and added to the scheduler. This way, we assume JobDetail to be our main "Job Definition" containing all the information needed to run the job (custom parameters, arguments etc) and we are leaving Trigger objects to deal with the execution times. Just my two cents.
8cfe48835db34903853b0bb857f6d74561b15b2e72886314ebbc25393e906f17
['c55a275c10ab4651a55b7ded62cf9179']
Assuming you have an array with data: $scope.data = [ {name: '<PERSON>', surname: '<PERSON>'}, {name: '<PERSON>', surname: '<PERSON>'}, {name: '<PERSON>', surname: '<PERSON>'} ]; Showing in a simple html table as: <table style="width:100%"> <tr> <th><span class="sortable" ng-click="sortDataBy('name')">Name</span></th> <th><span class="sortable" ng-click="sortDataBy('surname')">Surname</span></th> </tr> <tr ng-repeat="record in data"> <td>{{record.name}}</td> <td>{{record.surname}}</td> </tr> </table> And keeping you current sort attributes (field and order) in a simple object: $scope.sortAttrs = { field: null, order: null }; Simply implement sortDataBy function as: $scope.sortDataBy = function(field) { $scope.sortAttrs.field = field; $scope.sortAttrs.order = $scope.sortAttrs.order == 'asc' ? 'desc' : 'asc'; var sortDataAsc = _.sortBy($scope.data, function(o) { return o[field]; }); $scope.data = $scope.sortAttrs.order == 'asc' ? sortDataAsc : sortDataAsc.reverse(); }; You can take a look in the above implementation in working plunker. Adding more fields like "discount" etc. is simple enough. Just add data for fields in $scope.data array and new column in html table.
fbf28ff6bf8d0ec4b00e427519189dc66b870b99077bb3f68c3f7a3e5102287c
['c56d413a765b4b67919a8b5a94205a0a']
For simplicity, this is what needs to be done for( let index = 0; index < objectArray.length; index++ ){ objectArray[index].qty = qtys[index].qty; } You can use the Browser's js console to understand where each value resides in a JSON Object and how to get a value from it. For example, run this in the console after initializing the objectArray objectArray[0].qty // This will give qty of the first object in the array You can use this to navigate inside a complicated object
73e8a345f85f61270bcc8b774cc88f96827d9f195ad5603b581c91a6d60efaf3
['c56d413a765b4b67919a8b5a94205a0a']
There is also another way to achieve this on GitHub, Just try to create a new Pull Request with the branches you would like to compare. For example branch-1 <- branch-2 or branch-2 <- branch-1 On the bottom, you can see the file and commit difference between those branches. Just don't Create the Pull request if you don't want to merge these two.
cceceda64e91993a139e542021a934a8b86782039a9c86969c854482a5f9d136
['c572740ec99a40c086af06b0b893278c']
I'd be very interested in hearing your update about the priority queue. I struggled with that a lot when I was writing the algorithm and was never really happy with my workaround of sorting on every iteration when a maximum of one item would be out of order. Also, guess I should have said in the initial question, there are no other maps available for this game.
717093c28ba407e4ef600000dc7458b9308cf599a3fd579fe7da31adc47ba0e7
['c572740ec99a40c086af06b0b893278c']
How is asymptotic analysis (big o, little o, big theta, big theta etc.) defined for functions with multiple variables? I know that the Wikipedia article has a section on it, but it uses a lot of mathematical notation which I am unfamiliar with it. I also found the following paper: http://people.cis.ksu.edu/~rhowell/asymptotic.pdf However the paper is very long and provides a complete analysis of asymptotic analysis rather than just giving a definition. Again the frequent usage of mathematical notation made it very hard to understand. Could someone provide a definition of asymptotic analysis without the complex mathematical notation?
4a4a7249d66c647127a3d28d83d684aa6bb0c1a41c44dd87f1575fd65a1c674c
['c58d7739c2864b8ba07b849e8fb07c63']
When building gcc-4.8.1, I met a cp command as following: #!/bin/sh set -x fname="cp.sh" cp -v $fname.{,.bk} It will occurs error when execute this script: <29>pli[1050]@~/workspace/shell*0 > sh cp.sh + fname=cp.sh + cp -v cp.sh{,.bk} cp: missing destination file operand after âcp.sh{,.bk}â Try 'cp --help' for more information. <30>pli[1051]@~/workspace/shell*0 > But when type it on cmd line directly, it works well as expected. It is very in comprehensive to me.\n <28>pli[1049]@~/workspace/shell*0 > cp -v cp.sh{,.bk} cp.sh -> cp.sh.bk <29>pli[1050]@~/workspace/shell*0 > ^C
bdc9759dbcd2475dd8b0555cd6016745717ab064ba905d14495684eecda78d9c
['c58d7739c2864b8ba07b849e8fb07c63']
Recently I took a look into how plt and got implemented, and wrote a chunk of sample code for tracing as below. And something I saw confused me a lot. got.c #include <stdio.h> static int static_data; int global_data; extern int count; int main(void) { static_data = 12; global_data = 32; add_count(); count += static_data; count += global_data; printf("error, %p\n", &count); return count; } extern.c #include <errno.h> #include <stdio.h> int count = 0x1; void add_count(void) { errno = 0xdead; count += errno; fprintf(stdout, "%p\n", &count); fprintf(stdout, "%p\n", &count); fprintf(stdout, "%p\n", &count); } and compile it like this: gcc -shared -fpic extern.c -o extern.so sudo cp extern.so /lib/libextern.so gcc -g got.c -o got.bin -lextern question 1: why global variable address of count in libextern.so is 0x601048 ? question 2: for external symbol, use .plt and .got.plt for lazy binding, but for global variable like count, why 32-bits use get_pc_thunk for reference .got, and 64-bits just 0xXXX(%rip) for addressing .got ? Or 32-bit can use this rip + offset way for addressing .got of libextern.so ? Thanks in advance! when -m32 compiled function add_count: 550 5bf: 83 ec 14 sub $0x14,%esp 551 5c2: e8 c9 fe ff ff call 490 <__x86.get_pc_thunk.bx> 552 5c7: 81 c3 39 1a 00 00 add $0x1a39,%ebx 553 5cd: e8 ae fe ff ff call 480 <__errno_location@plt> 554 5d2: c7 00 ad de 00 00 movl $0xdead,(%eax) 555 5d8: e8 a3 fe ff ff call 480 <__errno_location@plt> 556 5dd: 8b 10 mov (%eax),%edx 557 5df: 8b 83 e4 ff ff ff mov -0x1c(%ebx),%eax 558 5e5: 8b 00 mov (%eax),%eax 559 5e7: 01 c2 add %eax,%edx when function add_count compiled to X86_64 64 bits: 567 789: e8 d2 fe ff ff callq 660 <__errno_location@plt> 568 78e: c7 00 ad de 00 00 movl $0xdead,(%rax) 569 794: e8 c7 fe ff ff callq 660 <__errno_location@plt> 570 799: 8b 10 mov (%rax),%edx 571 79b: 48 8b <PHONE_NUMBER> mov 0x200826(%rip),%rax # 200fc8 <_DYNAMIC+0x1c0> 572 7a2: 8b 00 mov (%rax),%eax 573 7a4: 01 c2 add %eax,%edx mmap FYI 00400000-00401000 r-xp 00000000 08:01 1975032 /home/pli/validation/got.bin 00600000-00601000 r--p 00000000 08:01 1975032 /home/pli/validation/got.bin 00601000-00602000 rw-p 00001000 08:01 1975032 /home/pli/validation/got.bin 7ffff7813000-7ffff79ce000 r-xp 00000000 08:01 5771356 /lib/x86_64-linux-gnu/libc-2.19.so 7ffff79ce000-7ffff7bcd000 ---p 001bb000 08:01 5771356 /lib/x86_64-linux-gnu/libc-2.19.so 7ffff7bcd000-7ffff7bd1000 r--p 001ba000 08:01 5771356 /lib/x86_64-linux-gnu/libc-2.19.so 7ffff7bd1000-7ffff7bd3000 rw-p 001be000 08:01 5771356 /lib/x86_64-linux-gnu/libc-2.19.so 7ffff7bd3000-7ffff7bd8000 rw-p 00000000 00:00 0 7ffff7bd8000-7ffff7bd9000 r-xp 00000000 08:01 5767525 /lib/libextern.so 7ffff7bd9000-7ffff7dd8000 ---p 00001000 08:01 5767525 /lib/libextern.so 7ffff7dd8000-7ffff7dd9000 r--p 00000000 08:01 5767525 /lib/libextern.so 7ffff7dd9000-7ffff7dda000 rw-p 00001000 08:01 5767525 /lib/libextern.so 7ffff7dda000-7ffff7dfd000 r-xp 00000000 08:01 5771353 /lib/x86_64-linux-gnu/ld-2.19.so 7ffff7fed000-7ffff7ff0000 rw-p 00000000 00:00 0 7ffff7ff8000-7ffff7ffa000 rw-p 00000000 00:00 0 7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso] 7ffff7ffc000-7ffff7ffd000 r--p 00022000 08:01 5771353 /lib/x86_64-linux-gnu/ld-2.19.so 7ffff7ffd000-7ffff7ffe000 rw-p 00023000 08:01 5771353 /lib/x86_64-linux-gnu/ld-2.19.so 7ffff7ffe000-7ffff7fff000 rw-p 00000000 00:00 0 7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
bb3edb641567be2e0fc975c881cc7c92c997b9dae3929208e17e1c1582d79ea2
['c59726e6078b4ff2a52baa1cfe64936e']
CV is a relative variability that is used to compare the variability of different sample dataset. For a you example, the same standard deviation/variance with smaller mean will generate a smaller CV. it indicates that smaller CV dataset has smaller relative variability. Assume You earn 10000 monthly, and I earn 100.(different mean) we all probably loss 100 monthly (vriation), I will be hurt far more than you since I get a bigger CV(cv=1 compared to yours 0.01), relative greater variation.
3086a2115519b6c2f8f3f7d5161a13a60471439aa3182d0c976743ab971afbbf
['c59726e6078b4ff2a52baa1cfe64936e']
Select a positive natural number at random. For all n, the probability of selecting that number n is zero. Yet the sum for all n of (probability of selecting number n) is 1. So there is some restriction in measure theory (maybe it's obvious and I've just forgotten it) which prevents us from constructing that sum from 1 to infinity of (probability of selecting number n) in the usual way. What?
3d650214f47a67fcbff7fa57953ab03e04e3b8e0340eb5ea0dc527b41e1db3f6
['c59a6f20e51141668e8b12e870d5aef6']
You want a global declaration, global Monster at the beginning, in either the function chooseMonsterClass or in fightSequence. Try both (at once). so it should be: import random def choosePlayerClass(): class <PERSON>: health = 100 attack = 10 defense = 10 class <PERSON>: health = 75 attack = 15 defense = 7 class <PERSON>: health = 50 attack = 20 defense = 5 playerChoice = input("What class do you want to be? (<PERSON>, <PERSON>, <PERSON>)? ") if playerChoice == "<PERSON>": Player = <PERSON>() elif playerChoice == "<PERSON>": Player = <PERSON>() elif playerChoice == "<PERSON>": Player = <PERSON>() return Player def chooseMonsterClass(): global Monster class Goblin: health = 25 attack = 10 defense = 5 description = "<PERSON>" class Troll: health = 50 attack = 13 defense = 7 description = "<PERSON>" class Orc: health = 75 attack = 15 defense = 10 description = "<PERSON>" monsterChoice = input("What kind of monster do you want to fight? (<PERSON>, <PERSON>, <PERSON>)? ") if monsterChoice == "<PERSON>": Monster = <PERSON>() elif monsterChoice == "<PERSON>": Monster = <PERSON>() elif monsterChoice == "<PERSON>": Monster = <PERSON> return Monster def fightSequence(): global Monster Player = choosePlayerClass() Monster = chooseMonsterClass() encounter = 1 turn = 'player' while encounter == 1: if turn == 'player': action = input("What would you like to do (Attack)? ") if action == 'Attack': encounter = humanAttack(Player) turn = 'monster' elif turn == 'monster': encounter = monsterAttack(Monster) turn = 'player' fightSequence()
6fef69c33936e576c4e2332f90fd5eade5a31f78f49c49b4df76bcbeab9f03e4
['c59a6f20e51141668e8b12e870d5aef6']
You want to add the extra line tries += 1 in the while loop. What this does is add 1 to tries every guess. So then your code would be: import random secretNumber = random.randint(1,100) secretNumber = int(secretNumber) print("Guess a number between 1 and 100!") number = input("Your guess: ") number = int(number) tries = 1 while number != secretNumber: if number > secretNumber: print("Too high!") number = input("Your guess: ") number = int(number) if number < secretNumber: print("Too low!") number = input("Your guess: ") number = int(number) while number == secretNumber: print("You got it in",tries,"tries") break
8b3705e4176eadfe9c184315e763f27550546969afb8d8cf27709a71855e3e22
['c5ac63c87e064758a90160304533acdf']
http://forums.xamarin.com/discussion/7327/system-net-webexception-error-nameresolutionfailure <PERSON>'s solution works for me: "For me, in release mode, I checked the box marked Internet in the Required permissions section of the AndroidManifest.xml file found under the Properties folder. Debug mode doesn't need this checked but Release mode does - which you need if sending the APK by email for installation - which works great by the way. In case anyone is interested, you also have to sign your app and produce the private key following these instructions here: http://developer.xamarin.com/guides/android/deployment,testing,_and_metrics/publishing_an_application/part_2-_publishing_an_application_on_google_play/"
405aec24668b21c64c013f0256ec52d9222d0da21940164aa5dff7ec92542542
['c5ac63c87e064758a90160304533acdf']
I m trying to use a rust pre-build library in my flutter project. I put my core.so in android/app/src/main/jniLibs/ directory, both in "arm64-v8a" and "armeabi-v7a" sub directory ofcourse. Then I add main.jniLibs.srcDirs = ['src/main/jniLibs'] in app/build.gradle And I load my so in dart: > final DynamicLibrary greeterNative = Platform.isAndroid > ? DynamicLibrary.open("rustcore.so") : DynamicLibrary.process(); then define the method: typedef GetGenesisFunction = Pointer<Uint8> > Function(Pointer<Uint8>, int); typedef GetGenesisFunctionFFI = > Pointer<Uint8> Function(Pointer<Uint8>, Int32); final > GetGenesisFunction rustGenesis = > greeterNative.lookup<NativeFunction<GetGenesisFunctionFFI>>("rust_call").asFunction(); Okay, I run my flutter app in debug and profile mode, and everthing is ok, the method from rust core.lib works. However, when I build with "--release" , it tells me: I/flutter ( 8547): Invalid argument(s): Failed to load dynamic library (dlopen failed: library "core.so" not found) I found the release apk and decompress it, I can see the core.so is right there with "libflutter.so" and "lipapp.so" so What's the problem, thank you so much~~~~
c88500d98976c230a40c3b5898c719cacad358ce287c7736284a2bb9ec4ae188
['c5b6162f1e32467990a20042f7e39776']
@T.Verron another late comment, sorry. But I think in that case, the manager is probably short-minded. If an employee identifies a problem that no one identified, it has to be asserted if it's a real problem or not. Sometimes the employee suggestion can have no cost to the team/company and can help improve a situation. Listening is hard, more than meets the eye, but if someone just dismiss an employee opinion/vision because it's unique, that's another problem.
b4d642122f4a2dbd0aaef39e4bb09a528b9ff94a7486a0d2f2188588a4740345
['c5b6162f1e32467990a20042f7e39776']
What field are you in? As someone in STEM (CS), most of those points just don't apply. A PhD in CS is only a plus if you're doing research, for everything else it just doesn't matter. Worse: You lose those 4+ years of experience which would be very valuable for getting better jobs and get paid more. And the assumption that a PhD makes you generally smarter instead of very knowledgeable in some small specialized area you're considering seems incredibly dubious. Hell there are people with two PhDs from Harvard and MIT who couldn't operate a coffee machine.
16c3dfcde05a9a7877cd3e37c948f216cc0d3022e5d688ec7ac1846abef20fe9
['c5c29b6647c04f089c8da62b940ee870']
I have a server thread that is receiving messages from a client that is using NetCat, however when I quit netcat (Either with CTRL-D or CTRL-C) on the client, the server gets stuck in an infinite loop. The server loop looks something like: while((recv(socket, message, 1024, 0) >= 0){ //Do work with message } I think the work is irrelevant here as it is just some string comparing, but like I said when I quit it seems that this loop just goes infinitely. I have heard that NetCat quitting is effectively an EOF, but how would I check for that and break the loop?
5743264339af842180315bebd981b8ec504e264755d8a647f0d15bb7bf6c72b7
['c5c29b6647c04f089c8da62b940ee870']
I need to load a series of single-word lines from a file into an array, so I made a function to do so. The function takes char*** arr as a parameter, which is a pointer to the array of strings. I allocate memory then have this loop to load words into the array. i=0; FILE *fp = fopen(filename, "r"); while(fgets(tok, WORD_BUFFER, fp) != NULL){ (*arr)[i] = tok; printf("Word %d:%s", i, (*dict)[i]); i++; } //arr is a char***, tok is a char[WORD_BUFFER], and WORD_BUFFER is 50 My problem is that this seems to be overwriting every entry of the array with whatever I'm trying to enter to entry [i]. I say this because the output of the loop above for a file that looks something like this: A B C D Seems to print correctly, however when I print the array in the main function (or even just later in that function), it will print out like: D D D D I'm guessing it has something to do with my use of fgets or the assignment of (*arr)[i] = tok but I'm not sure. Thanks!
4889ed0cfeffd67a480e009f7a061e79816a72014821ef40d9e066d552772a18
['c5c364982b8d47e2b660beda8b3771fe']
Consider the vectors $x^{(1)}(t) = (t,1)$ and $x^{(2)}(t) = (t^2, 2t)$ I computed the Wronskian which is t^2. I also know that it's continuous everywhere except when t=0. But I was wondering how to solve the following question: 1) Find the systems of equations $x' = P(t) \cdot x$. I am using Elementary Differential Equations and BVP textbook by <PERSON> but in nowhere does it teach me the techniques of finding $P(t)$. Thanks for help!!
dd409aea18533affe39fd5b4cd2d40f88f0dd633696c1a252a2e7170bcf4e10b
['c5c364982b8d47e2b660beda8b3771fe']
To validate different approaches I added array and jsonb columns in the work table. work table will have id and work_data table has work_id which is referring to id in the work table. I have presented simplified version of work table here.but it has lot of other columns which are details of the work and priority score of work. with the two tables and join approach , the query is taking 40 to 50 secs, as it has to scan through all rows in work_data table
2ae55e18c5bd0b0e764447292f6479f15c80d6178924ab0a771c0a9472f7fc87
['c5cd6167aa3f4118acca9e61e1f0b595']
Just to complete the post, we had success in reducing this problem with three things: 1) We made extra checks to make sure that the IP is matched to the session ID, and logout the user otherwise. We could then use this to track how often the problem occurs. 2) We switched to XCache and immediately saw lower number of confused session IDs. However, under very heavy load the problem rears its ugly head again. 3) We then double the memory for Xcache in the php config (xcache.size and xcache.var_size) and now the problem is gone. So we suspect either APC or Xcache running out of memory was the problem. We're still waiting to see if this is a permanent solution.
2467f247aa640b81a06687fc89c128a9ebdc9210383636a22b6641b4810363e8
['c5cd6167aa3f4118acca9e61e1f0b595']
A quick disclosure: I come from R background and am switching to pandas (running on python 3.3.3). I would like to select rows from a dataframe by using text from a dataframe entry. It's an elementry operation but I could not get around the syntax. For example, with this DataFrame (sorry for the line split but I want to make the example clearer): films = pandas.DataFrame({'$title':[ "The Godfather", "Pulp Fiction", "The Godfather: Part II", "Fight Club"], '$director': [ "Coppola, <PERSON>", "Tarantino, <PERSON>", "<PERSON>, <PERSON>", "Fincher, <PERSON>"]}) If I want to select all the films created by the first director, which would be "<PERSON>, <PERSON>", the command I am using is: In [1]: director = films.iloc[[1]]["director"] In [2]: director 1 <PERSON>, <PERSON> Name: director, dtype: object In [3]: a = films[ films["director"] == director ] ValueError: Series lengths must match to compare If I do this: In [4]: a = films[ films["director"] == str(director) ] I get an empty DataFrame. What's going on here? Seems like I'm missing something.
681d07ddf7cebc42a354de17482643d55cd00b0b0afa372c2f897533b319c0ee
['c5cef37336d04d1fbb6ad5ea2c7a6945']
Below is the script I created to modify existing calendar events. My goal is to change the description to have it change from a Register button to Registration Closed. The script works in that it will add guests, however it will not update the description to the new description when the max number of registrants has been exceeded. I did not include the part of the script that details the calProperties. function modifyEvents() { var ss = SpreadsheetApp.getActive(); var sheet = ss.getSheetByName("Events"); var sheetR = ss.getSheetByName("Registration"); var headerRows = 1; var dataRange = sheet.getDataRange(); var data = dataRange.getValues(); for (var i = 1; i in data; ++i) { if (i << headerRows) { var row = data[i]; var room = row[5]; var description = row[6]; var agegroup = row[7]; var registration = row[8]; var max = row[10]; var calname = row[14]; var eventId = row[15]; var registrants = row[17]; var calendarName = sheet.getRange(headerRows + i, 15).getValue(); var calendarId = calProperties.getProperty(calendarName); var cal = CalendarApp.getCalendarById(calendarId); var id = sheet.getRange(headerRows + i, 16).getValue(); var event = cal.getEventSeriesById(id); var email = sheetR.getRange(headerRows + i, 8).getValue(); row[10] = sheet.getRange(headerRows + i, 11).getValue(); row[17] = sheet.getRange(headerRows + i, 18).getValue(); if (registration === 'Y' && registrants >> max) {//7.1 line 25 var description1 = (description + '\n' + '\n' + room + '\n' + '\nEvent Type: ' + calname + '\n' + '\nAge Group: ' + agegroup) var descriptionHTML = '\n <div id="registration_button" ><a style="text-align:right;color:white!important;text-decoration:bold;background-color:rgb(209,72,54);background-image:-webkit-linear-gradient(top,rgb(221,75,57),rgb(209,72,54));color:#ffffff;border:1px solid rgba(0,0,0,0);border-radius:2px;display:inline-block;font-size:12px;font-weight:bold;height:27px;line-height:27px;padding:0px 20px 0px 20px;text-align:center;text-transform:uppercase;white-space:nowrap;text-decoration:none;color:white" target="_blank">Registration Closed</a>'; var descriptionRegistration = (description1 + '\n' + '\n' + descriptionHTML); event.setDescription(descriptionRegistration); } } } }
08700689b368fac09469826e0aa8c7038076996eed6ae0c584f38340e646cd6a
['c5cef37336d04d1fbb6ad5ea2c7a6945']
I need this script to delete the row (within the Registration sheet) with the matching Registration Code to the Cancel Registration sheet's Registration code. As of now, this script only deletes a row if "sheetR.deleteRow(i);" is not inside "if (regCodeR === regCodeCR) {}". It doesn't delete the correct row either. function rD() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheetR = ss.getSheetByName("Registration"); var sheetCR = ss.getSheetByName("Cancel Registration") var dataR = sheetR.getDataRange().getValues(); var dataCR = sheetCR.getDataRange().getValues(); var headerRow = 1; for (var i = 1; i in dataR && i in dataCR; ++i) { var rowR = dataR[i]; var rowCR = dataCR[i]; var duplicate = false; var regCodeR = sheetR.getRange(headerRow + i, 10).getValues(); var regCodeCR = sheetCR.getRange(headerRow + i, 9).getValues(); if (rowR[9] === rowCR[8]) { duplicate = true; } } if (regCodeR === regCodeCR) { sheetR.deleteRow(i); } }
68243265798a8be0f3fad232096d2141a87a474d0bd29792df53a4195e45d1ed
['c5d9456810aa42d48bfe5d7a0bcf0a21']
I just simply typed the code given in tf.Tensor Tensorflow 2.2.0, and here is my code: please i want solution for thi Error !! print(tf.__version__) a=2 b=3 c=tf.add(a,b,name='add') print(c) sess = tf.Session() print(sess.run(c)) sess.close() output 2.2.0 tf.Tensor(5, shape=(), dtype=int32) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-34-0f2b1dd0c6d9> in <module>() 4 c=tf.add(a,b,name='add') 5 print(c) ----> 6 sess = tf.Session() 7 print(sess.run(c)) 8 sess.close() AttributeError: module 'tensorflow' has no attribute 'Session'
92d92172d837184b22ebb99b9a4a1f3118a9b04aa6d941d8da5e6e5951f235f8
['c5d9456810aa42d48bfe5d7a0bcf0a21']
When I run this code in google colab n = 100000000 i = [] while True: i.append(n * 10**66) it happens to me all the time. My data is huge. After hitting 12.72 GB RAM, but I don't immediately get to the crash prompt and the option to increase my RAM. I have just this Your session crashed after using all available RAM. View runtime logs What is the solution ? Is there another way ?
642d6f85d623b7fe6a27b4cc197bbfb0b0e75cac315ed233b932efe71666b07c
['c5e65362dee74c40a8769ab39019476c']
I need to output the following query in XML format for SQL 2000. It seems that I have too many subqueries and the nesting levels for XML in SQL 2000 must be exact. Any help is appreciated. SELECT sd.dbid AS DatabaseID ,NAME AS DatabaseName ,CASE WHEN NAME IN ( 'master' ,'msdb' ,'model' ,'tempdb' ,'distribution' ) THEN 'S' ELSE 'U' END AS SysUserType ,cmptlevel AS CompatibilityLevel ,databasepropertyex(NAME, 'Collation') AS CollationName ,CASE WHEN databasepropertyex(NAME, 'Status') = 'ONLINE' THEN 0 WHEN databasepropertyex(NAME, 'Status') = 'RESTORING' THEN 1 WHEN databasepropertyex(NAME, 'Status') = 'RECOVERING' THEN 2 WHEN databasepropertyex(NAME, 'Status') = 'RECOVERY_PENDING' THEN 3 WHEN databasepropertyex(NAME, 'Status') = 'SUSPECT' THEN 4 WHEN databasepropertyex(NAME, 'Status') = 'EMERGENCY' THEN 5 WHEN databasepropertyex(NAME, 'Status') = 'OFFLINE' THEN 6 WHEN databasepropertyex(NAME, 'Status') = 'COPYING' THEN 7 END AS STATE ,databasepropertyex(NAME, 'Status') AS StateDesc ,CASE WHEN databasepropertyex(NAME, 'Recovery') = 'FULL' THEN 1 WHEN databasepropertyex(NAME, 'Recovery') = 'BULK_LOGGED' THEN 2 WHEN databasepropertyex(NAME, 'Recovery') = 'SIMPLE' THEN 3 END AS RecoveryModel ,databasepropertyex(NAME, 'Recovery') AS RecoveryModelDesc ,crdate AS DatabaseCreationDate ,B.last_db_backup_date AS LastBackupDate ,a.SizeMB AS SizeMB ,c.NumberOfConnections AS ActiveDBConnections ,SERVERPROPERTY('Machinename') AS SQLServerName ,CASE WHEN SERVERPROPERTY('Instancename') IS NULL THEN 'Default' ELSE SERVERPROPERTY('Instancename') END AS SQLServerInstanceName ,SERVERPROPERTY('ProductVersion') AS SQLServerVersion ,SERVERPROPERTY('Edition') AS SQLServerEdition FROM ( SELECT CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS SERVER ,msdb.dbo.backupset.database_name ,MAX(msdb.dbo.backupset.backup_finish_date) AS last_db_backup_date FROM msdb.dbo.backupmediafamily INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id GROUP BY msdb.dbo.backupset.database_name ) AS B FULL JOIN sysdatabases sd ON sd.NAME = b.database_name INNER JOIN ( SELECT (SUM(size) * 8 / 1024) AS SizeMB ,dbid FROM sysaltfiles GROUP BY dbid ) AS A ON sd.dbid = a.dbid FULL JOIN ( SELECT DB_NAME(dbid) AS DBName ,COUNT(dbid) AS NumberOfConnections FROM sysprocesses WHERE dbid > 0 AND spid >= 51 GROUP BY dbid ) AS C ON sd.NAME = C.DBName ORDER BY sd.dbid I was able to write this for SQL 2005 and above and works fine! But cannot for the life of me get it for SQL 2000 SELECT sd.database_id AS DatabaseID ,sd.NAME AS DatabaseName ,CASE WHEN sd.NAME IN ( 'master' ,'msdb' ,'model' ,'tempdb' ,'distribution' ) THEN 'S' ELSE 'U' END AS SysUserType ,sd.compatibility_level AS CompatibilityLevel ,sd.collation_name AS CollationName ,sd.STATE AS STATE ,sd.state_desc AS StateDesc ,recovery_model AS RecoveryModel ,recovery_model_desc AS RecoveryModelDesc ,create_date AS DatabaseCreationDate ,B.last_db_backup_date AS LastBackupDate ,a.SizeMB AS SizeMB ,c.NumberOfConnections AS ActiveDBConnections ,SERVERPROPERTY('Machinename') AS SQLServerName ,CASE WHEN SERVERPROPERTY('Instancename') IS NULL THEN 'Default' ELSE SERVERPROPERTY('Instancename') END AS SQLServerInstanceName ,SERVERPROPERTY('ProductVersion') AS SQLServerVersion ,SERVERPROPERTY('Edition') AS SQLServerEdition FROM ( SELECT CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS SERVER ,msdb.dbo.backupset.database_name ,MAX(msdb.dbo.backupset.backup_finish_date) AS last_db_backup_date FROM msdb.dbo.backupmediafamily INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id GROUP BY msdb.dbo.backupset.database_name ) AS B RIGHT JOIN sys.databases sd ON sd.NAME = B.database_name INNER JOIN ( SELECT (SUM(size) * 8 / 1024) AS SizeMB ,database_id FROM sys.master_files GROUP BY database_id ) AS A ON sd.database_id = a.database_id FULL JOIN ( SELECT DB_NAME(dbid) AS DBName ,COUNT(dbid) AS NumberOfConnections FROM sys.sysprocesses WHERE dbid > 0 AND spid >= 51 GROUP BY dbid ) AS C ON sd.NAME = C.DBName ORDER BY sd.database_id FOR XML RAW ('DATABASES'), ROOT ('SERVERROOT'), Elements
41ba25e86c6342a25352d75189448ea34d65d2b2c6ea107e7394667b3ceb4827
['c5e65362dee74c40a8769ab39019476c']
I am having trouble returning the following query in well formed XML. The best I can figure is to use the AUTO, Elements but that doesn't return any root. Any help is appreciated. I have no issues in SQL 2005 or above, just trouble with SQL 2000 (which will be getting upgraded soon :) ) SELECT dbid AS DatabaseID ,NAME AS DatabaseName ,CASE WHEN NAME IN ('master','mb','model','tempdb','distribution') THEN 'S' ELSE 'U' END AS SysUserType ,cmptlevel AS CompatibilityLevel ,databasepropertyex(NAME, 'Collation') AS CollationName ,CASE databasepropertyex(NAME, 'Status') WHEN 'ONLINE' THEN 0 WHEN 'RESTORING' THEN 1 WHEN 'RECOVERING' THEN 2 WHEN 'RECOVERY_PENDING' THEN 3 WHEN 'SUSPECT' THEN 4 WHEN 'EMERGENCY' THEN 5 WHEN 'OFFLINE' THEN 6 WHEN 'COPYING' THEN 7 END AS State ,databasepropertyex(NAME, 'Status') AS StateDesc ,CASE databasepropertyex(NAME, 'Recovery') WHEN 'FULL' THEN 1 WHEN 'BULK_LOGGED' THEN 2 WHEN 'SIMPLE' THEN 3 END AS RecoveryModel ,databasepropertyex(NAME, 'Recovery') AS RecoveryModelDesc ,crdate AS DatabaseCreationDate ,(SELECT MAX(bs.backup_finish_date) FROM msdb.dbo.backupset AS bs WHERE bs.database_name=name) AS LastBackupDate ,(SELECT (SUM(saf.size) * 8 / 1024) FROM sysaltfiles AS saf WHERE saf.dbid=dbid) AS SizeMB ,(SELECT COUNT(sp.dbid) FROM sysprocesses AS sp WHERE dbid > 0 AND spid >= 51 AND sp.dbid=dbid) AS ActiveDBConnections ,SERVERPROPERTY('Machinename') AS SQLServerName ,CASE WHEN SERVERPROPERTY('Instancename') IS NULL THEN 'Default' ELSE SERVERPROPERTY('Instancename') END AS SQLServerInstanceName ,SERVERPROPERTY('ProductVersion') AS SQLServerVersion ,SERVERPROPERTY('Edition') AS SQLServerEdition FROM sysdatabases ORDER BY DatabaseID FOR XML AUTO, ELEMENTS
2201e8d2691ddfd0f3727e4b74b2f41bdc2c93acff8380bbdc9a170190c0de3f
['c5eb4240a8fb4db09c03e6dc90cf8a8d']
Disclaimer: I'm very new Node developer and pretty new to javascript also. I have a lot of experience with Java, C++, and frameworks around those, so I understand development paradigms, but I'm not that familiar with how JS is structured or design patterns yet. And I'm in a bit of a pickle to get this done quickly :/ Our node application needs to make requests to services that require OAuth2 authentication. Our app can successfully request and receive an OAuth bearer token, and it also can make requests to services using that token. But its all very decoupled. What I'd like to do is hook up an intercepter to the request module (we are using request-promise) that is called as such: The request module passes control to us prior to calling the requested service We get our cached copy of the oauth token headers OR request a new token and build the headers (and cache it) We insert the new oauth token headers to the request Then return control to the request module for normal execution I looked at request-promise and see that it's doing something similar in terms of hooking onto the 'request' module. And looking at the nodejs 'request' module, it looks like there's possibly a hook for adding OAuth headers. My question is how to I leverage the hook if it exists. And is this the best approach? Finally, is there an example/pattern for this specific case. I see lots of examples for OAuth in node, but most of it is for authenticating an incoming client, not an outgoing request, and the examples I find have a very decoupled process similar to what we already have. Many thanks in advance for any assistance on this.
44cb3e17faf1aca4aaa1ac0226d0edeada6c806fd042d936c6d90f0f30281828
['c5eb4240a8fb4db09c03e6dc90cf8a8d']
Your initial working directory in vim is the directory you're in when you start vim. If you're in a directory other than your project directory when you start vim, :e will not change your current directory to your project directory when you open a file, so if you just use :e to open different files, you'll have to specify the path each time. eg: say your project path is /project/foo and you cd to /project and open vim. To open /project/foo/a.txt, you'll have to :e foo/a.txt. If you then want to open file /project/foo/b.txt, you'll have to :e foo/b.txt. :e doesn't change the current working directory in vim. If you cd /project/foo then start vim, you can just do :e a.txt and :e b.txt You could also do :cd foo from within vim in the scenario above. Hope this helps
5eaee4de90fc162a2a2f8b132b961c8647674714930bc36acb11dca7c360fad9
['c5ed3023ed7c4b08a5dc75e5e38ff672']
I have a ListView showing options choose date, choose time. I have an inner class implementing OnDateSetListener, and OnTimeSetListener. Is there any way to update the items after date or time was set? listViewOptions = (ListView) findViewById(R.id.listview_options); String[] options = new String[]{"Choose date...", "Choose time..."}; ArrayAdapter<String> optionsAdapter = new ArrayAdapter<>( getApplicationContext(), R.layout.simple_list_item, options ); listViewOptions.setAdapter(optionsAdapter); listViewOptions.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Calendar date = Calendar.getInstance(Locale.US); switch (position) { case 0: { //show date picker DatePickerDialog datePicker = new DatePickerDialog( context, new MyListener(), date.get(Calendar.YEAR), date.get(Calendar.MONTH), date.get(Calendar.DAY_OF_MONTH) ); datePicker.getDatePicker().setMinDate(date.getTimeInMillis()); datePicker.show(); break; } case 1: { TimePickerDialog timePicker = new TimePickerDialog( context, new MyListener(), date.get(Calendar.HOUR_OF_DAY), date.get(Calendar.MINUTE), false ); timePicker.show(); break; } } } }); the inner class: private class MyListener implements DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { //change text of the "choose date..." item } @Override public void onTimeSet(TimePicker view, int hourOfDay, int minute) { //change text of the "choose time..." item } }
b18de771c134651c731d55e801f0f878c86b9a404bcc3dc6aadcc1b3049fab2e
['c5ed3023ed7c4b08a5dc75e5e38ff672']
I'm trying to query my Devise-created table with find_by_sql and am running into a strange error. User.find_by_sql("select username from user") results in: PG<IP_ADDRESS>UndefinedColumn: ERROR: column "username" does not exist LINE 1: select username from user : select username from user ActiveRecord<IP_ADDRESS>StatementInvalid: PG<IP_ADDRESS>UndefinedColumn: ERROR: column "username" does not exist LINE 1: select username from user ^ : select username from user Here's my devise migration (I added the username field): class DeviseCreateUsers < ActiveRecord<IP_ADDRESS>Migration def change create_table(:users) do |t| ## Database authenticatable t.string :username, null: false t.string :email, null: false, default: "" t.string :encrypted_password, null: false, default: "" ## Recoverable t.string :reset_password_token t.datetime :reset_password_sent_at ## Rememberable t.datetime :remember_created_at ## Trackable t.integer :sign_in_count, default: 0, null: false t.datetime :current_sign_in_at t.datetime :last_sign_in_at t.string :current_sign_in_ip t.string :last_sign_in_ip t.timestamps null: false end add_index :users, :email, unique: true add_index :users, :reset_password_token, unique: true end end As you can see I have declared the field username. Querying other tables in this manner works perfectly. I have also tried User.find_by_sql("select 'username' from user"), and that just returns [#<User id: nil>]. Thanks! Edit: want to add that User.last returns #<User id: 1, username: "xxxxxx", email: "xxxxxxxx", encrypted_password: "xxxxxx", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 2, current_sign_in_at: "2016-06-26 20:16:59", last_sign_in_at: "2016-06-25 22:00:31", current_sign_in_ip: "xxxxx", last_sign_in_ip: "xxxx", created_at: "2016-06-25 22:00:31", updated_at: "2016-06-26 20:16:59"> with the correct values in place of 'xxxxx'
b02d9f5ca64301e72cf6aee93e85ad8a6c6de07236f247aee38bf842ffbb418e
['c5ef5b36249b495483384d37bf0aa748']
I have a Windows application that I need to migrate to web. This application has many forms that follow the same pattern: (1) a grid on the left with columns and rows than can be selected, and (2) buttons on the right to perform actions. Here is an example: While this is a very common design layout in windows applications, I noticed that it isn't quite as common on the web. For the web version, I considered adding the action buttons inside each line. However, I discarded it because (1) the screen gets quickly polluted with lots of buttons, and (2) some buttons are dangerous and inlining them makes it more likely that the user clicks them by mistake. Other forms have more columns or more buttons, they all more or less follow the same layout as a Windows app. What would be the best UX design to migrate these forms to Web? Would it still be a grid with selectable rows and action buttons on the side?
4b98de9898266fb95715ef2e4196a86c3a4a9f5c173acacc95857a898ef9c928
['c5ef5b36249b495483384d37bf0aa748']
I developed RSI (tenosynovitis), similar to carpal tunnel in both wrists a few years ago, so I certainly can understand the need to want to switch to speech for coding. Unfortunately there's really not a lot out there that gets the job done in a decent way - as has already been mentioned code navigation is extremely frustrating by voice alone, and the wide array of unusual characters us programmers need just don't help the matter for general use! I personally used Dragon Naturally Speaking for around 3 months but eventually decided that it simply wouldn't work as a long term solution. It was suggested to me by a physiotherapist to try an ergonomic keyboard, Maltron (with the Maltron layout) specifically. Considering that I cripple in pain with a standard keyboard I can now code pain-free all day long. They do (or used to) a rental model so that you can try it out. Even if you're not in a position to be using a keyboard now, it might be worth considering in the future.
276d9cf87004aff27bf4924db32627d38da1d0d46c0b28de599a43cc224bdbef
['c5f1624e9d2b49d2ad0f80ca5b833d70']
Not sure if this is possible. I have searched most of the afternoon. Every search on anything related to "web services" returns nothing i need. I have a site that downloaded to my local machine. Actually there are two sites. Is there a method and/or tool out there that will show me the "web services" that are being called on a page as I click through the site? I don't want to see the code or anything, I just want to see the "web service" name. So for example, click on link one, i want something that will show me webser1a and webser2b were called Click on link two, i want something that will show me webser12h and webser342cb were called. You know if you use firebug or chrome developer tools, you can see the css files or js files - is there anything that can do this web services - again, i don't want to see the code as you actually with a css file via firebug, i just want to see that xxxx webservice(s) called.
b5efdc64d6ffd3becf5cec3b9c4474be66d9ac5b1c2ffe6e499f51067598368b
['c5f1624e9d2b49d2ad0f80ca5b833d70']
Finally got this working - for anyone that encounters the same circumstance - in drupal be sure you have the iframe parameters set correctly where you are add your code. I add my php code in a content type and select the node to phpFilter for the text format type. Next and this was somethin i didn't know about, go to chrome extension an search for xdebug helper. Enable it, open up netbeans, go back to your site and click on the debug icon that will appear in your url entry bar.
10b082b8483aa6b7c4b83e6ac2ab0a0b58788a43208389babebcb9a705cad333
['c5f8a6a45620491e8ae8af53aaebf3f5']
You need to add errors checking into your code. This can help you to figure out what is causing the problem. public function countryLookupApiCall() { if (isset($_POST['action']) && isset($_POST['country'])) { $country = $_POST['country']; $apiKey = $this->getApiKey(); $url = $this->url . $country . '/callCharges?apiKey=' . $apiKey . '&response=JSON'; $response = wp_remote_get($url); if (is_wp_error($response)) { $error_code = $response->get_error_code(); $error_message = $response->get_error_message(); $error_data = $response->get_error_data($error_code); // Process the error here.... } echo $response; die(); } } Also you are using echo on wp_remote_get result. As defined in documentation wp_remote_get returs WP_Error or array instance. So you should use something like this: echo $response['body'];
4cb254c1a487049d9c714b99e64d8cacd7790da7864bdad1bbad3cb522457c9b
['c5f8a6a45620491e8ae8af53aaebf3f5']
edvler/yii2-adldap-module is just a proxy class. It has some errors since the adldap/adLDAP package is no longer maintained. Looks like edvler extension in no longer maintained too. You can rewrite it using Adldap2/Adldap2 package or use my extension instead: https://github.com/alexeevdv/yii2-adldap