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
e1dedd0512c77c98b89b1f471427f03f90f25143eb4676f15002d1fda4c11dab
['ec4fd85073e549c69327e665bde21276']
My question is different with the typical one. Assume we have, X = ['123', '456', '789'] And, we want to find whether another list is in X with exact same order. For example, A = ['123', '456'] # should return True since A in X with same order B = ['456', '123'] # should return False since elements in B are not in same order with X C = ['123', '789'] # should return False since elements in C are not adjacent in X Can anyone give me any idea?
29b58adf48dec489cda360ba9d7c1d510a8a84881215aedd629649b904ec24ed
['ec4fd85073e549c69327e665bde21276']
df is like this, A B C 0 NaN 150 -150 1 100 NaN 150 2 -100 -150 NaN <PHONE_NUMBER> NaN 4 NaN 150 150 5 100 NaN -150 Another array is array([1, 2, 3]) I want to replace non-null value in each column with each value in array, and the result will be, A B C 0 NaN 2 3 1 1 NaN 3 2 1 2 NaN 3 1 2 NaN 4 NaN 2 3 5 1 NaN 3 How can I achieve this in a simple way? I write something like, df[df.notnull()] = np.array([1,2,3]) df[df.notnull()].loc[:,] = np.array([1,2,3]) but all cannot work.
6c7ab95b105dd86e518429c8a266effda150e541b7f65089bea0ab79a0c62c6f
['ec5166062f864c999270c31aa1827cb6']
I already send batch messages using C# libs. I want to do the same thing using python, how to do it? Actually I'm able to send single messages but batch send will increase my throughtput. This is the code: from azure.servicebus import ServiceBusService key_name = 'RootManageSharedAccessKey' # SharedAccessKeyName from Azure portal key_value = '' # SharedAccessKey from Azure portal sbs = ServiceBusService(service_namespace, shared_access_key_name=key_name, shared_access_key_value=key_value) sbs.send_event('myhub', '{ "DeviceId":"dev-01", "Temperature":"37.0" }') I think it's possible because on the manual it says: "The event content is the event message or JSON-encoded string that contains multiple messages." Link to the manual
c40802177af751d9012b148cd58468f89ba9aeec42375ca9533eb6527593f66d
['ec5166062f864c999270c31aa1827cb6']
I'm mapping different tables on C# classes. i.e. If I've a table named "T" with columns "A" and "B", in C# I create something like that in my code: class T{ A{get;set;} B{get;set;} } My problem is with joined tables, what is a correct way to represent two joined tables in 1-1, 1-n, n-n relations? I'm not using Entity Framework and I cannot use it.
091a76eeba032d6f7ef3dd3ff8019172a9731960b2a1fadefc09de2ac6721439
['ec546b2f5a2746478e739b6628aaa585']
When you check the notes from the boost module you might see that the lines in area type series won't be drawn. That is why you might think that colours looks flatter. * Notes for boost mode * - Area lines are not drawn * - Lines are not drawn on scatter charts * - Zones and negativeColor don't work * - Dash styles are not rendered on lines. * - Columns are always one pixel wide. Don't set the threshold too low. * - Disable animations * - Marker shapes are not supported: markers will always be circles, except * heatmap series, where markers are always rectangles. Please compare these two charts: Without the boost module and without the lines: https://jsfiddle.net/BlackLabel/8u0so132/ With boost: https://jsfiddle.net/BlackLabel/ugocansh/ They look very similar, I can even say that the one with boost looks sharper.
a535501a65fc1da059d12dbdec35b7ae33d3d366fc7d187ff4226f58290fdac9
['ec546b2f5a2746478e739b6628aaa585']
You can use the Highcharts module called no-data-to-display because using innerHTML / outerHTML is not ideal because it's not pertuculary safe. I recreated it in Angular similarly to what you might see in the API (I used a slightly simpler example since your has additional thins and seeing the difference might be difficult). First I imported the module and initialized it with the Highcharts. Then I used the recommended way of updating the data. When the data array is empty, Highcharts handles that and show a message that there is no data. You might customize that mesage- see the API. API: https://api.highcharts.com/highcharts/noData Demo: https://stackblitz.com/edit/highcharts-angular-no-data-to-display
6b4d9b80e6532e7ffe569421f27d19cd14424204cbef21418b0081a636d8737f
['ec5e69b8b505478c8a9859f5b5daa224']
I want to draw the following implicit function with gnuplot x**2+y**2+(z-1)**3-2 I know that maple or matlab can to this very simple but I want to use gnuplot. Up to know I have no idea so I can't provide a starting point. sorry Here the result plotted with maple
673fdbb42bab85cf663e7c5ae9327840d7f98456a601fe565656010fa9080e51
['ec5e69b8b505478c8a9859f5b5daa224']
I have the following part of a Makefile #.SILENT: #.PHONY: SHELL := /bin/bash ################################################################ ## Colordefinition ################################################################ NO_COLOR = \x1b[0m OK_COLOR = \x1b[32;01m ERROR_COLOR = \x1b[31;01m %.pdf: %.tex NAME=`basename $< .tex` ;\ echo -e "\t$(OK_COLOR)Typesetting $$NAME$(NO_COLOR)" ;\ pdflatex -draftmode -interaction=nonstopmode $< > /dev/null ;\ if [ $$? = 0 ] ; then \ echo -e "\t$(OK_COLOR)compilation in draftmode without erros$(NO_COLOR)" ;\ pdflatex -interaction=nonstopmode $< > /dev/null ;\ if [ -e $$NAME.glo ] ; then \ echo -e "$(OK_COLOR)Typesetting $$NAME.glo$(NO_COLOR)" ;\ makeindex -s gglo.ist -o $$NAME.gls $$NAME.glo ;\ fi ;\ if [ -e $$NAME.idx ] ; then \ echo -e "$(OK_COLOR)Typesetting $$NAME.idx$(NO_COLOR)" ;\ makeinde -s gind.ist $$NAME.idx ;\ fi ;\ else \ echo -e "\t$(ERROR_COLOR)compilation in draftmode with erros$(NO_COLOR)" ;\ exit 0;\ fi ;\ echo -e "\t$(OK_COLOR)Typesetting $$NAME finished $(NO_COLOR)" ;\ The makefile doens't work and I can't find the error. My goal is to type: make test.pdf The following example can be used for testing (test.tex): \documentclass{article} \begin{document} Hello World! \end{document} How must the Makefile improve?
b98746a365bf6c2ea89cde61794da8bfd0874b6cff8fc84fe7baf8f14302e880
['ec6358536570497ea093a8447693ea25']
I want to watch specific variable in visual studio 2010. For example, string stringVar = "blablabla"; I want to know when this variable is created? when modified or when assigned something to it. -- In my application, one of variable value changing abruptly and I can not figure out why and I dont want to debug whole code.
023f1c4114291f9bc9d56342bbafa7771091a228e4c25ad762422fbe8feb6114
['ec6358536570497ea093a8447693ea25']
Simply, I created an asp.net web site on IIS7 When I click on the "browse google.com on *:80(http)" it opens the real google.com not mine... So that, I can not be sure my site is working properly or not. (I dont want to make google1.com to see it is working) I change the hosts file : xxx.yyy.zzz.kkk google.com now, when I browse the google.com it returns 404 not found when I browse the xxx.yyy.zzz.kkk it returns 404 not found I know that IIS working properly... I know that Physical path is correct... So any idea why browsers returns 404 not found? Is it related with the physical file permission? I gived all permissions to SYSTEM and I clicked OK and then when I check again it was returned pervious state... I didnt work..
e71f32800258563df78941c0d45b88c8f1a9040765a8c73cfe402201b43e97c1
['ec6986e7515c4748ace88a0f86355149']
To use .htaccess : Redirect [URL source] [URL dest] So : Redirect www.example.com/blog www.example.com/blog/ Should works pretty good Generally, people wants to delete the final "/" and not to add it. Are you tryng to do that on all your pages, or only a specific case ? Otherwise try something like : RewriteEngine on RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301,NC]
cde86feeca4c2f9267cc4907b7ddbbfe7e6a8e41aa3abd962efdfa2b5ee68cc5
['ec6986e7515c4748ace88a0f86355149']
Getting into spam box is relative to : Subject Sender Name Sender Email It works like reputations, and if you use something "<EMAIL_ADDRESS>" for your testing purpose you have great chance to get into spambox, no matter what code you are using ! At least try to test with plausible Emails, like your own personal one
be103b3632da73a5af893e77f3af73ada4d73f0d66e2ae64a707e4e7f2504ef9
['ec8fee1cbffb48049daaced9fdca71c9']
I have few problems with installation GeoDjango. I tried install SpatiaLite for using it with SQLite and PostGIS for PostgreSQL with this tutorial: https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#spatial-database but no working results. Actually I have DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', ... } } GEOS_LIBRARY_PATH = '/usr/lib/libgeos_c.so.1' GDAL_LIBRARY_PATH = '/usr/lib/ogdi/libgdal.so' in my settings.py and I get error: AttributeError: /usr/lib/ogdi/libgdal.so: undefined symbol: GDALVersionInfo I have installed gdal package and path to these libraries are correct. I did't find anything else what can I do to get ride with this error. What is problem with this error? Should I install some more packages? I use Python2.7 and Django 1.8
e2e70558873099223818d0123c53e35b996ae83346fb75f0cbe388a42b16beec
['ec8fee1cbffb48049daaced9fdca71c9']
How can I check if the page is open in the active tab? I want to mute video on my website, when user leave tab. Currently I'm using: $(window).on('focus', function() { $("video").prop('muted', false); }); but when user click on adressbar video is muted, so this is unexpected. Can I avoid this behavior? The best solution is something like at this webpage: http://volkswagen-sportscars.fr/cars/ when user open other tabs in browser, sounds is smoothly turned down. How it's made?
d00a322215c6a3ac25284347cec12ddb6a840c63ce96578fcf24a1640e6b03c4
['ec904884f0ab47f49fa646aa6a4b912b']
I have a site running on php Modx Revo engine and served by nginx. I have a lot of files in the root folder and now they are accessible from the internet with mysite.com/README.md urls. I want to deny access to all of them except files with extensions I want to manually specify (json, js, html and png); Here is my nginx config server { listen 443 ssl; server_name mysite.com; access_log off; root /var/www/mysite.com; index index.php; #ssl stuff location / { root /var/www/mysite.com; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_ignore_client_abort on; fastcgi_param SERVER_NAME $http_host; fastcgi_buffer_size 128k; fastcgi_buffers 4 128k; } location ~*^.+\.(jpg|jpeg|gif|png|css|zip|pdf|js|ico|html) { root /var/www/mysite.com/; access_log off; expires max; } } I need help with new nginx rule to deny access to all files in the root folder (site.com/cronjob.sh, site.com/anyfile.anyext) except files with .json, .js, .html, .png extensions (site.com/data.json, site.com/pic.png)
21a2385767fc8cfb26875f7c1b6f574bc965f43b33aafb70de32b943fac25857
['ec904884f0ab47f49fa646aa6a4b912b']
I have this rule location ~ ^/images/cars/(.*) { return 301 /images/car/regular/gallery/$1; } But I also want to redirect /images/car/*.jpg files. If I do this location ~ ^/images/car/(.*) { return 301 /images/car/regular/exterior/$1; } then first rule is going recursively. So my question is how to exclude subfolders in this pattern ~ ^/images/car/(.*) to avoid grabbing /images/car/folder/folder/folder/123.jpg but to take only /images/car/imagefile.extension
afa6942ad28169e65a23382ad1da4decfbbb6efe75bfaf42b43036c86f5b5491
['ec95bd691cc14d358e3e20f282244ded']
Array ( [0] => Array ( [id] => 1 [member_id] => 8 [total] => 5 [mainroomid] => 2 ) [1] => Array ( [id] => 2 [member_id] => 11 [total] => 2 [mainroomid] => 2 ) [2] => Array ( [id] => 3 [member_id] => 8 [total] => 8 [mainroomid] => 2 ) [3] => Array ( [id] => 4 [member_id] => 11 [total] => 3 [mainroomid] => 2 ) [4] => Array ( [id] => 5 [member_id] => 29 [total] => 4 [mainroomid] => 2 ) [5] => Array ( [id] => 6 [member_id] => 8 [total] => 5 [mainroomid] => 1 ) [6] => Array ( [id] => 7 [member_id] => 11 [total] => 3 [mainroomid] => 1 ) ) The above data is returned from the MySQL database, my logic get stuck here which is I want to loop the data accordingly and rearrange the data into a new array. Does it mean that all the same member id I need to sum up all the total and separate based on the mainroomid. Anyone can help with this ya :(? Below is the data that I need to show. Final data [0] => Array ( [0] => Array( [member_id] => 8 [total] => 13 [mainroomid] => 2 ) [1] => Array( [member_id] => 11 [total] => 5 [mainroomid] => 2 ) [2] => Array( [member_id] => 29 [total] => 4 [mainroomid] => 2 ) ) [1] => Array ( [0] => Array( [member_id] => 8 [total] => 5 [mainroomid] => 1 ) [1] => Array( [member_id] => 11 [total] => 3 [mainroomid] => 1 ) )
82e8f272ed7af21262ccbb29b237a06073634086bd05f1ed352c932726f6ffa5
['ec95bd691cc14d358e3e20f282244ded']
Data Array ( [0] => Array ( [member_id] => 1 [total] => 0 [numrow] => 1 ) [1] => Array ( [member_id] => 16 [total] => 0 [numrow] => //should fill in 3 ) [2] => Array ( [member_id] => 5 [total] => 3 [numrow] => 0 ) [3] => Array ( [member_id] => 6 [total] => 5 [numrow] => //should fill in 4 ) [4] => Array ( [member_id] => 92 [total] => 15 [numrow] => 2 ) ) Sorry for asking stupid questions. Currently, I have stuck in this logic, I want to fill in the empty data value inside the array, it will loop all the data and get the current numrow data and then +1 and fill into the empty value. Any expert can help with this ya?
a0d685adb35c992797838b0ebe22b6e80df04ba16902bb64d5b9c15c3735a686
['ec9a07617d5e43308ef7e0c2fead062b']
I need a bat to delete all files with the RELATIVE name that are NOT contained in a text file In the text file list.txt i have this: C:\S-ATLANTICO-1\MEDIA\Innplay-Logo.mp4 C:\S-ATLANTICO-1\MEDIA\logo-FB_sep.png C:\S-ATLANTICO-1\MEDIA\logo-news_sa.png and the in the same folder have this files: Innplay-Logo.mp4 logo-FB_sep.png logo-news_sa.png Carlos.jpg Sapo.png list.txt So i need to delete the next files because not exist in list.txt Carlos.jpg Sapo.png but i also MUST KEEP the LIST.TXT i have tried this but without sucess @echo off setlocal set "folder=C:\S-ATLANTICO-1\MEDIA" set "excludeFile=C:\S-ATLANTICO-1\MEDIA\list.txt" for /f "eol=: delims=" %%F in ('dir /b /a-d "%folder%" ^| findstr /vig:"%excludeFile%" ^| findstr /v /i "\list.txt"') do del "%folder%\%%F" any one can help me with this. Thanks
b07adb3f6deff87a3ce5bf3159e44db792487355e001e55f545f630a1560977f
['ec9a07617d5e43308ef7e0c2fead062b']
Who can help me on this? Pause Countdown when press "P" Key and continue the Countdown when press "S" key. Until now i have this code, but i cant find the way to solve this. Thanks from multiprocessing import Process import keyboard import time def countdown_1(): i=6 j=40 k=0 while True: a = keyboard.read_key() if(str(a) != "p"): if(j==-1): j=59 i -=1 if(j > 9): print(str(k)+str(i)+":"+str(j)) else: print(str(k)+str(i)+":"+str(k)+str(j)) time.sleep(1) j -= 1 if(i==0 and j==-1): break if(i==0 and j==-1): print("END") time.sleep(1) countdown_1()
a5c84457cc2b0f649a4e4c3460632c786342aa406a22abd4735e9b0b32555ab7
['ec9c7773e0324fc5a5c2a183793808fc']
Try opening the file you're writing to in append mode rather than write mode. In your save_csv function, with open('test_case.xlsx','w', newline='')... will overwrite the file if it already exists. To add onto an existing file, you want with open('test_case.xlsx','a', newline='').... Reference: https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files
7e6e4e82a6da378b5d4cee8279be9a0e504d58ebbe57a24de7b09a1444361d73
['ec9c7773e0324fc5a5c2a183793808fc']
If you don't want to use regular expressions, try simply going character by character: def rSeriesValidate(tag): if len(tag) < 1 or len(tag) > 9: return False for currChar in tag: if not currChar.isalnum() and currChar != "-": return False return True This first checks for the input length requirement, and returns False if it is not met. For input of suitable length, it goes on to check each character of the input. If it finds a disallowed character (one that is not alphanumeric and not a dash), it returns False.
352a114f3ff255da471777bbce6eb00e364e2641e7fc487ea969185d528c034b
['eca16044c03f4948855652dca0af308e']
You can use the date function to format the time, as what you're getting is a date as a string, you can use strtotime. I think the format you're looking for is: date("Y-m-d", strtotime($Row["ETA"]));, you can either parse that into a variable and save it there, or you can concatenate the results together for the final string.
ad9dbdf97937617183bba47f58791b9d2f29c585d46a12ccac79fde1fdfc5dc0
['eca16044c03f4948855652dca0af308e']
The problem is that you're binding it to a click on all elements with the class ".but", if you on the other hand gave the button an id like echo '<input data-pid="'. sha1($product_id) . '" class="but" type="button" value="Add Cart" />'; and then in your jquery function would do the following (outside the loop): <script> $(document).ready(function(){ $('.but').click(function(){ $.ajax({ type: 'POST', url:"addcart.php", data : $(this).data(), success:function(result){ $("#div1").html(result); } }); }); }); </script> Then you would get around the problem, as it then listens for the click event on each element, but the data is varying on each element. I hope this helps.
8fe342486aa5ae127facea0a1c434a80a18f24e2c36cfb8ece3c9c906a5f900b
['eca97c6fc64942f59470a480a0a421c6']
I added the plugin by using the link at cli. Plugin: phonegap local plugin add org.apache.cordova.device Plugin-Link: https://github.com/hazemhagrass/phonegap-base64 Now I did copy the code in my controller, but it does not work. Code: //filePath is the absolute path to the file(/mnt/sdcard/...) window.plugins.Base64.encodeFile(filePath, function(base64){ console.log('file base64 encoding: ' + base64); }); My question is, how do I activate the plugin? Like using for example "$cordovaCamera". Maybe somebody can show me a correct controller example. Thanks for your help.
ca47dd7834b53e7d39092349d00883444a0f5b82471cb3efc1cf9d98bf1eda01
['eca97c6fc64942f59470a480a0a421c6']
My problem is, that the controller just send an undefiend and not the data from http of service. I inspect it with chrome. I am new at ionic. By calling the AppSqliDBFactory.getMasterdataId() method, it shows an undefiend, also at the scope variable. .controller('ReadMasterdataCtrl', function ($scope, $state, $ionicNavBarDelegate, MasterdataService, AppSqliDBFactory){ $scope.masterdataId; $scope.masterdataData; AppSqliDBFactory.getMasterdataId().then( function (masterdata){ $scope.masterdataId = masterdata[0].masterdataId; }).catch(function (err){ console.log(err); }); //here is the error -> no data at "$scope.masterdataData = masterdata;" MasterdataService.getMasterdataDB($scope.masterdataId) .then(function (masterdata) { $scope.masterdataData = masterdata; console.log("getMasterdataDB respont"); console.log($scope.masterdataData); }).catch(function (err) { console.log(err); }); }) //Service .factory('MasterdataService', function ($q, $http, SERVER_URL) { //Create JSON Object var srv = {}; //Array for JSON Objects srv.masterdata = []; srv.getMasterdataDB = function (masterdataId) { var deferred = $q.defer(); var masterdata; var masterdataId = masterdataId; var baseUrl = 'xxxx'; $http.get(SERVER_URL + baseUrl + masterdataId).success(function (response){ masterdata = response[0]; console.log(masterdata); return deferred.resolve(masterdata); }).error(function (err){ return deferred.reject(err); }); return deferred.promise; //return srv.getMasterdata(); }; // Public API return { getMasterdataDB: function ( masterdataId) { return $q.when(srv.getMasterdataDB( masterdataId)); } }; });
e165c8f8235a24e50a0f984dcc82c94ac461489e86b9b0e8172dba99310891f0
['ecb04ef4657b4d0fa668dbe4e9dd2edf']
For debugging Java APP from eclipse, Run application/programming in debugging mode. For remote debugging, add debugging option to java process and connect to it using Eclipse remote debugging options. Plus if you have changed your code and applied breakpoints, then needless to say you need to rebuild your project. And breakpoint should be reachable in code flow.
1edbf15fd9fccc0f94dde031922da576c8bbbab0877f8894670e234ed83e2587
['ecb04ef4657b4d0fa668dbe4e9dd2edf']
GC reclaims object, when an object no longer referenced becomes claimable candidate. For basic app one cannot be sure if GC runs with in process lifetime. Thus here is a small example for testing theory: public class Test { static class Sample { @Override protected void finalize() throws Throwable { System.out.print(this + " The END"); } } public static void main(String...args) throws Exception { // Extra care Runtime.getRuntime().runFinalization(); Sample sample = new Sample(); sample = null; // Object no longer referenced System.gc(); // Ensures FULL GC before application exits Thread.sleep(1000); // Relax and see finalization out log } }
5c9fb251a12f4d08b110c4ade7e35b9d93277a8f3016ea0d6409e0a955d95ae5
['ecb0fe0f10e34b8aba888545a8ca928f']
Yes, you are right - this question is some what out of focus - but I think that this question bothers some people anyways ;-) According to the announcements made at Google I/O 2014, technically speaking, any Wear-device is a stand-alone device: It can work without a connected phone and it can run its own applications (but they have to be installed by using a paired Android-phone). But while the Wear-device is stand-alone you probably won't have much fun with it, when you don't pair it with a phone and use it as an accessory: without a network-connection, there won't be much you can do (except from showing the current time and how many steps you have taken).
813d7f4f138c2bdaf95cac5e55194deb7f4195be5c268a1e7d425c1d432a7370
['ecb0fe0f10e34b8aba888545a8ca928f']
Does the one-page-notification you get show "My App" / "Hello Wear !"? This would be logical, because you are building this notification (var notificationBuilder) and actually have it displayed (notificationManager.notify()). For the two-page notification, you create the first and second page - but when merging the first and the second page into twoPageNotification, you are using notificationBuilder instead of notificationCompatBuilder for your first page. Additionally, that built, two-page notification twoPageNotification is never passed to the notify() function. So adding a notificationManager.notify(notificationId,twoPageNotification) should display those two pages.
f231ddee37610b6edca6d4f0c4a66b1ad6a0a8657c8fe49538e1439627350d04
['ecb84bd5b7b044c2bd2420e550c40a08']
I have created variance with English and German and its reference URL is added in current and global navigation. I want to update title of variance site in current and global navigation. How to do that? SPNavigationNodeCollection quickLaunchNav1 = web.Navigation.QuickLaunch; PortalSiteMapProvider sitemapprovider = (PortalSiteMapProvider)SiteMap.Providers["CurrentNavSiteMapProvider"]; SiteMapNode rootNode = sitemapprovider.CurrentNode; if (rootNode.ChildNodes.Count > 0) { foreach (SiteMapNode childNode in rootNode.ChildNodes) { if (childNode.Title.Equals("de-de")) { childNode.Title = "Test"; } } } But in child node there is not any property of update. How to update title of child node?
2cc568b1c9b263b34c7bc09fb5276cf7b11aa08cc7651e4c82c4540fba9a4520
['ecb84bd5b7b044c2bd2420e550c40a08']
In this case: You can either use Layer Clipping Masks or Closed Shapes with Shared Walls. I'd say Clipping Masks are ideal and more efficient way of working. I've also noticed that your joints overlap - this is because the shapes are Open Shapes with Strokes aligned to the outside of the shape. I'll upload a PSD of 'solutions' for the above two points in my original answer.
e580af6594cd97b5af6f0df7f7b80a5ab667d2808f509fca3088a3ff68c48f2d
['ecbdf983cba545e8aedfe8e8b6a50ad1']
I have a tcl driver script which in turn calls several other programs. I want to invoke a python script from my tcl script. lets say this is my python script "1.py" #!/usr/bin/python2.4 import os import sys try: fi = open('sample_+_file', 'w') except IOError: print 'Can\'t open file for writing.' sys.exit(0) and tcl script is "1.tcl" #! /usr/bin/tclsh proc call_python {} { exec python 1.py } This doesn't give any error but at the same time it does not perform the operations present in the python script. What should replace the code fragment "exec python 1.py" in 1.tcl to invoke the python script? Can a python script be invoked using exec? Thanks in advance!!
9d9eab713811306db1a409cd77ec79cf305e2800ad334162748ca89780e7eadc
['ecbdf983cba545e8aedfe8e8b6a50ad1']
I am trying to run the gcc testsuite using a driver script in tcl. When i write if {[catch {exec make check RUNTESTFLAGS="compile.exp --target_board=atmega128-sim"} errmsg ]} { puts "Test finished with failures\n $errmsg" } else { puts "Test finished" } This gives error as Test finished with failures make: unrecognized option `--target_board=atmega128-sim"' Usage: make [options] [target] ... ...... But if I remove the compile.exp from the RUNTESTFLAGS, it works fine. if {[catch {exec make check RUNTESTFLAGS="--target_board=atmega128-sim"} errmsg ]} { ..... Is it because of the double quotes present in argument RUNTESTFLAGS? I need to run make check with different RUNTESTFLAGS. Please suggest a way to achieve this. Thanks in advance !!
850a817071d519826bc0dd14f3b222d5d4cb3dc8cd7e1049e0d75d6143c1895e
['ecc2c2e628964e7987a2698f76e07115']
There are some selectors that are wrong as other's have pointed out. Also, I would use closest('.colors_storage_outer') with a selector so it goes up the tree and stops at the selector. You can do this with parents too (parents('.colors_storage_outer')). Then look for the select from there. try: $("body").on('click', "input.select2-search__field", function (event) { console.log($(this).closest('.colors_storage_outer').find('> select').attr('data-id')) })
a133fa8d97818c0da5c79643b44c911b21ccfee74a8c3dea602c366aab102adf
['ecc2c2e628964e7987a2698f76e07115']
viewStatisticsArray.indexOf() == -1 won't work because each element of the array is different (the dates are different). You could do: var viewedByItem = viewStatisticsArray.filter(function(d) { return d.viewedBy == itemName.viewedBy; }); if (viewedByItem.length == 0) { viewStatisticsArray.push({viewedDate: Date(), viewedBy: Meteor.user()._id }); } or if you still want to use indexOf(), you could make a map function to return the viewedBy property of each object: var viewedByPeople = viewStatisticsArray.map(function(d) { return d.viewedBy; } if (viewedByPeople.indexOf(itemName.viewedBy) == -1) { viewStatisticsArray.push({viewedDate: Date(), viewedBy: Meteor.user()._id }); }
499c101d403f6bb12567b4bf1b59ed5b17ca4cfba223fb4077642e159199de84
['ecc33f2ab0484e35b13b341ed52069f3']
I'm working on reformatting a badly formatted powerpoint using a master slide layout and am having issues. First off, I need to apply a custom bullet to all 80 or so slides. I changed a master slide to reflect that but it doesn't want to take on the regular slides. Second, the master layout has images in the bottom of the slide (company logo). When I create a new slide with the master layout, it looks fine. However, I want to keep the image placement that is already in the slides that I'm reformatting so I need to apply the master layout to the already created slides. The company logo's will not show up when I apply the master slide.
a86247ef0a5d5ad9a3e6490f7d6a18acd695adedaf51a0e45c29b1d053cc3445
['ecc33f2ab0484e35b13b341ed52069f3']
I think I understand what you are asking for... So narrow my question down and provide links showing the research I've done yes? Guilty as charged on the attitude thing; I've been halfheartedly googling for solutions for months to fix my frustration with the current system I use. Thank you.
a04d0d49a9366b5b7e4b5177477882f8b565fa902301c6f44d7e39152ab4cdfd
['eccc22b43fb8436296d789875098ec5d']
So for some reason when I hover over specific points below an image link I have that is wrapped in a div, it will trigger the hovering effect for the image link that I have created through CSS. I have tried multiple things (overflow:hidden, display:inline-block) but nothing seems to work. I will post my code and a jsfiddle link. Thanks in advance. HTML: <div class="div_for_projects"> <div class="project_inner_divs"> <div id="portfolio_project"> <div id="portfolio_project_child"> <a href="index.html"> <!-- Image Source: http://www.connectwithchildlife.com/2015/10/child-life-portfolio.html --> <img class="portfolio_page_projects" src="http://www.vandelaydesign.com/wp-content/uploads/portfolio2.jpg" alt="portfolio_image"> </a> <p> <a href="index.html" class="text_align project_description"> PROJECT </a> </p> <a href="#"> <img class="portfolio_sm_links" src="https://maxcdn.icons8.com/Share/icon/Editing//arrow_filled1600.png" alt="Portfolio Image Link"> </a> </div> </div> </div> </div> CSS: .div_for_projects { width: 100%; height: 420px; } .project_inner_divs { float: left; width: 35%; } #portfolio_project { position: relative; width: 426px; height: 420px; pointer-events: none; transition-duration: 0.4s; } #portfolio_project_child { pointer-events: auto; width: 100%; height: 100%; } #portfolio_project:hover { -webkit-filter: brightness(70%); } #portfolio_project:hover .project_description { visibility: visible; opacity: 1; } #portfolio_project:hover .portfolio_sm_links { visibility: visible; opacity: 1; } .portfolio_page_projects { width: 426px; height: 420px; } .project_description { position: relative; bottom: 250px; visibility: hidden; opacity: 0; transition-duration: 0.4s; font-size: 18px; font-family: Tahoma, Geneva, sans-serif; color: rgb(50, 50, 50); display: inline-block; left: 170px; } .text_align { text-align: center; } .portfolio_sm_links { width: 40px; height: 40px; position: relative; bottom: 130px; left: 350px; visibility: hidden; display: inline-block; opacity: 0; } .portfolio_sm_links:hover { background-color: grey; } jsfiddle link: https://jsfiddle.net/26vutwz9/
6687c226696ee6a8ad74b0460e59dddff8e66a504c0b2ba169e2f25c52bc3e0c
['eccc22b43fb8436296d789875098ec5d']
So I have a link of an email on my page that is supposed to transition from its base color (light-ish green) to a darker green when you hover over it. I have confirmed that it works in Chrome, IE, Edge, and Opera. It only does not work in Firefox. I also have it where it does the same thing with a border at the bottom of the link when you hover over it and that works in Firefox fine, just not the color of the link for some reason. Any help would be appreciated. Here is my code: HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <!-- This is so viewing website is scaled well on all devices --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- This is where I am getting all my icons from --> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css"> <!-- Image by fontawesome.com. Here is link to image: https://fontawesome.com/icons/info-circle?style=solid --> <link rel="icon" href="Images/info-circle-solid.png"> <!-- To remove default browser styling --> <link rel="stylesheet" href="https://necolas.github.io/normalize.css/8.0.0/normalize.css"> <!-- My style sheet --> <link rel="stylesheet" href="css/style.css"> <!-- My Sass style sheet --> <link rel="stylesheet" href="css/sass_style.css"> <!-- JQuery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!-- My script --> <script src="JavaScript/javascript.js"></script> <title>About</title> </head> <body> <!-- Email section --> <section> <div class="component-div_margin component-div_width"> <h2 class="component-div_margin_h2_after_description">Contact</h2> <p>Here is my email if you wish to contact me. Click on my email address below to copy the address to your clipboard.</p> <a href="javascript:;" class="component-div_margin__email_color" id="green_email_one" onclick="CopyEmail('green_email_one')"><EMAIL_ADDRESS></a> </div> </section> </body> </html> CSS: /* Color palette courtesy of colorlovers.com. Here is the direct link to the color palette: http://www.colourlovers.com/web/trends/websites/7853/KICKSTARTER */ /* Design inspiration courtesy of <PERSON> from his portfolio website. Here is the link to it: http://www.colourlovers.com/web/trends/websites/7853/KICKSTARTER */ body { font-family: Arial, Helvetica, sans-serif; } h1,h2,h3,h4,h5,h6,p { margin: 0; font-weight: normal; } /* .component-footer_background_color__email_border_color: this is to add a margin to the bottom of the green email in the footer */ h1,h2,h3,h4,h5,h6,p, .component-footer_background_color__email_border_color { margin-bottom: 20px; } h1,h2,h3,h4,h5,h6,p,a { color: #34302D; } h1 { font-size: 30px; } h2 { font-size: 20px; } a { text-decoration: none; border-bottom: 1px solid white; } /* To create spacing between borders of webpage and spacing inbetween seperate divs on the page */ .component-div_margin { margin: 5% 5% 120px 5%; } .component-footer_background_color__a, #wider_screen_drop_down_menu_email, .component-div_margin_h2_after_description, .component-footer_background_color__a { color: #E6E6E6; } /* !important to remove previous color styling */ .component-header__left-div__nav_active_a, .component-div_margin__email_color, a:hover, .wider_screen_size_header_navigation_nav a:hover { color: #86C543 !important; } /* So these animations do not repeat */ .component-drop_down_menu_open_animation, .component-drop_down_menu_close_animation, .component-drop_down_menu_show_animation, .component-drop_down_menu_hide_animation, .from_black_to_green_border_animation, .green_email_one_border_animation { animation-fill-mode: forwards; } .from_black_to_green_border_animation, .green_email_one_border_animation { animation-duration: .3s; } .green_email_one_border_animation { animation-name: green_email_one_border; } /* #component-description_div__h2 has this to create more spacing in the intro */ p, #component-description_div__h2 { line-height: 30px; } /* To put anchor tags on seperate lines */ nav a:after { content: ""; display: block; height: 0; width: 1px; } /* To add seperation between links inside of navs when they are on seperate lines */ nav { line-height: 50px; } @keyframes green_email_one_border { from { color: #86C543; border-bottom-color: #86C543; } to { color: #6B9E35; border-bottom-color: #6B9E35; } } /* lines 335 - 418 */ /* MEDIA QUERIES */ @media only screen and (min-width: 480px) { .wider_screen_size_header_navigation { display: block; } .open_menu_div { display: none; } .component-header__left-div { width: 50%; } .component-header__right-div { width: 50%; } .projects_link { margin-right: 0px !important; } } @media only screen and (min-width: 768px) { .component-header__left-div { width: 25%; } .component-header__right-div { width: 75%; } .projects_link { margin-right: 25px !important; } #wider_screen_drop_down_menu_email { display: inline; margin-right: 0px !important; } .mobile_footer_div { display: none; } .component-footer_background_color__div { width: 50%; } .wider_screen_footer_div { display: block; } .component-footer_background_color__h2_after_first { margin-bottom: 35px; } .component-footer_background_color__first_div { width: 60%; } .component-footer_background_color__nav { line-height: 30px; } .contact_header { margin-bottom: 40px; } } @media only screen and (min-height: 537px) { .intro_div { margin-bottom: 240px; } } @media only screen and (min-width: 1000px) { .wider_screen_footer_div { display: none; } .widest_screen_footer_div { display: flex; } .wider_screen_footer_div_flex { width: 60%; } .component-footer_background_color__div { width: 25%; } .social_div_width { width: 40%; } .component-footer_background_color__first_div { width: 30%; } .component-div_width { width: 60%; } } JavaScript: //This function is to copy the emails on each page to the clipboard and to style the link //once it is clicked when the emails are clicked. function CopyEmail(id) { var range = document.createRange(); var selection = window.getSelection(); SelectEmailCopying(id, range); RemoveAllRanges(selection); selection.addRange(range); document.execCommand('copy'); RemoveAllRanges(selection); } //this function creates the range for the text of the email that is to be copied. function SelectEmailCopying(id, range) { if(id === "green_email_one") { range.selectNodeContents(document.getElementById('green_email_one')); } else if(id === "green_email_two") { range.selectNodeContents(document.getElementById('green_email_two')); } else if(id === "grey_email_one") { range.selectNodeContents(document.getElementById('grey_email_one')); } else if(id === "grey_email_two") { range.selectNodeContents(document.getElementById('grey_email_two')); } else if (id === "grey_email_three") { range.selectNodeContents(document.getElementById('grey_email_three')); } else if(id === "drop_down_menu_email") { range.selectNodeContents(document.getElementById('drop_down_menu_email')); } else if(id === "wider_screen_drop_down_menu_email") { range.selectNodeContents(document.getElementById('wider_screen_drop_down_menu_email')); } } //This function removes all ranges once copying is done. function RemoveAllRanges(selection) { selection.removeAllRanges(); } $(document).ready(function() { //Gives animation to the last email link before hitting the footer on hover $("#green_email_one").hover(function() { $("#green_email_one").addClass("green_email_one_border_animation"); }, function() { $("#green_email_one").removeClass("green_email_one_border_animation"); }); }); And a JSFiddle link for this code: https://jsfiddle.net/qb0d6caL/12/ Thanks.
dc1575fd8b6ca382a40ef1063f0876d2db337ae1bfb14d3931fc357aed423b0b
['ecce153cb2254ec481126728358ebc2d']
If your hard drive is failing then the the data on that drive is almost certainly corrupt. Save what you can of your files (document, picture, music, etc.) by connecting the drive to an operational computer (using a USB to IDE adapter works well). DO NOT do a system back up from failing or corrupt hard drive! You will only be creating headaches for yourself in the future.
346d88a49df23cc7200948ba98a550ae331745edc9e01211294630ca9e82584f
['ecce153cb2254ec481126728358ebc2d']
All of these ideas gave me something to go on. It also made me think another way about how to approach this problem so I can keep my terms simple. Sometimes you just need a good shove in the right direction and this was it for me. I've found what I'm looking for.
9ef5f5c7ce3c44ed0ecd624c33e5b72d18cdfdfe46504e86ac88e727f4a30263
['ecd51c0ad8f840a1b17e371e087e479a']
Consider this snippet: def populate(l): l.append(1) class First: __obj__ = [] class Second(First): populate(First.__obj__) def __init__(self): pass def __call__(self): for i in Second.__obj__: print(i) a = Second() a() When run, it will output 1, so it seems that First.__obj___ and Second.__obj__ point to the same object. Is it true and how does class property work in the case of inheritance?
77f817cc5b80ee842961cad3a6d3b3b510ad905e7230095068e29bd079aa104c
['ecd51c0ad8f840a1b17e371e087e479a']
I have a list of dictionaries l, each of them is a simple 1-level dictionary with the same keys a, b, c, d. Now I want to build a nested dictionary from l in this shape (i is an member of l): { i['a']: { i['b']: { i['c']: { i['d']: some_value, } } } } Right now I'm using this snippet: tmp = {} for i in l: if not i['a'] in tmp: tmp[i['a']] = {} if not i['b'] in tmp[i['a']]: tmp[i['a']][i['b']] = {} if not i['c'] in tmp[i['a']][i['b']]: tmp[i['a']][i['b']][i['c']] = {} tmp[i['a']][i['b']][i['c']][i['d']] = some_value Is that the most efficient way if the original list is huge?
2406ed15f19bb1b3d153f3b0a534f42fdc064323e1910190e8a2ca78715f3cda
['ecdeb6fc2184447c9a7afa2fffd67e29']
Certo! As variáveis de sessão quando inciadas, elas tem a durabilidade até o fechamento do browser, assim o usuário ativo terá essa variável mesmo mudando de página, ela não perderá o valor. No segundo trecho de código unset que é como expirar essa variável, ela perde o valor. Estou inserindo mais um trecho de código, onde verifica se a variável esta ativa, senão estiver não impede o acesso ao conteúdo da página.
7f78c64e4a47c373756249219eb49ef8aa9901269900fca79065357ae9460e2f
['ecdeb6fc2184447c9a7afa2fffd67e29']
I have been 'Promoted' to manager but in order for me to achieve my pay raise I have to 'prove myself', as I keep being told. I have ran perfect shifts for weeks now and every time I ask about it i get told I haven't been judged properly. The other manager at my store is on 8.50 and is younger than me, she also did not have to prove herself in order to get the pay raise, it was just given. I am also 5 months pregnant and have to prepare for a baby, doing more work for less money. Is there a law around this or anything I can do???
17092b722ae8e001f69c349d32be1b659ab17f29da1643a6f0a2b0c155a520a7
['ecf0ed5e60384c129130cdfbd06c58a6']
In some different situations in a request life cycle on my project, joining to some other tables may be required for the main query of that request. How can I join with a table if it was not already joined with that? In the other word I need some methods like this: context.query = context.query.join_if_not_already_joined(table2)
e5fa2d7d420dcb1830b6123838a1fa20091f54035a5fa26ed8de26163b6797b7
['ecf0ed5e60384c129130cdfbd06c58a6']
Have the fix. Needed to use overlay=eof_action=pass instead of overlay=0:0 Updated command, which works: ffmpeg -y -i myvideo.mp4 -r 30 -itsoffset 00:00:00.000 -i myoverlay.mov -filter_complex "[1:v]scale=640:360[ovrl], [0:v][ovrl]overlay=eof_action=pass[outv];[0:a][1:a]amix[outa]" -map [outv] -map [outa] -c:v libx264 -vcodec mpeg4 -r 30 -strict experimental -b:v 1500000 outputvideo.mp4
c6a920c4373218094113b1600dbfec0067ee6074d4ca43908a75e60f0ed8a21e
['ecf1823ea77448e5b8f18afcaf03c5d3']
I recently read The Elegant Universe by <PERSON> to understand more about relativity, quantum mechanics, and the conflict between them. What it says is that "the notion of a smooth spatial geometry, the central principle of general relativity, is destroyed by the violent fluctuations of the quantum world on short distance scales". I still don't understand why this is. Why can't small scales be random and with quantum foam, but when you zoom out, space curves smoothly like relativity predicts?
20a86716e7580f9283d35699d857b1ccab720e0e676cf97227bad0780bade48a
['ecf1823ea77448e5b8f18afcaf03c5d3']
Let us assume person <PERSON> and person Y. Both entered grad school in the same year, X as a PhD student (without a prior masters degree) and Y as a masters student in the same field. Towards, the end of second year, X realized that a PhD was too much for him and decided to quit but was eligible for a masters degree ( he had enough credits to do so). Both <PERSON> and Y graduate with a masters degree with good grades. Let's assume both of them were nearly equally matched in their profile ( w.r.t. projects, internships e.t.c). Who would a recruiter prefer for a technical position at their company : X or Y ?
26b6f5918a88fc92234149f9bada5ffa6dca3474840db8889ccf4b836ef8fc3a
['ed103005b7a64b559bf3a941ff1cd15a']
From what I understand, you want only the card to scroll, but not the rest of the content on the page. I've done this a few times in different contexts, but overall, this is a simple css-related fix. You want to add the css property overflow: auto as a property to anything that you may want to have scroll within itself. As far as I understand, there is no way to do this strictly with Angular Material directives, attributes, or classes. However, just adding a custom css class to the element in question and defining that in your css works great. Below, I've pasted your modified code from codepen into a snippet, followed by the modified codepen url. (function() { 'use strict'; angular .module('app', ['ngMaterial']); })(); .demo { width: 600px; height: 300px; background-color: #cccccc; margin-top: 40px; margin-left: 0px; } .scroll-this { overflow: auto; } <link href="http://rawgit.com/angular/bower-material/master/angular-material.css" rel="stylesheet"/> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-animate.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-aria.js"></script> <script src="http://rawgit.com/angular/bower-material/master/angular-material.js"></script> <div ng-app="app" layout="column" class="demo"> <md-toolbar> <h2 class="md-toolbar-tools"> <span>Toolbar</span> </h2> </md-toolbar> <div layout="row"> <md-card class="scroll-this" flex> Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/>Load of content <br/> </md-card> <div>Something here</div> </div> </div> http://codepen.io/anon/pen/bpdXeB
de3de0377a5199cd0caeda7ed98536cce4f2d11cc3dd7fd9ecd65ecda2dcd244
['ed103005b7a64b559bf3a941ff1cd15a']
One thing you should understand about setState is that it works asynchronously. If you try to console.log the state directly after calling setState, you won't see any changes yet. You also don't have to clear out the array by calling setState with an empty array--you can just replace the current array with the new array. this.setState({ items: newItems }); If you want to log the change, I'd suggest trying to do it in the component's componentShouldUpdate method.
7be4f48bf58cce1fb38a254db18e061755e5857cdf12ba22dbe80c5f3674b2a8
['ed1d182930db4c0b9269abc564c0d841']
<PERSON> we will easily get the base case but how to prove that if $ \sum\limits^{n}_{i=m}a_i+\sum\limits^{p}_{i=n+1}a_i=\sum\limits^{p}_{i=m}a_i$ is true then $\sum\limits^{n-1}_{i=m}a_i+\sum\limits^{p}_{i=n}a_i=\sum\limits^{p}_{i=m}a_i $ is also true. Here we face the same problem. We can get a term outside the summation inside if its the last term. If its the first term then we are in trouble.
9f25d98ff4f94b961ecc6669e973be2bcc1fa3c959b27cb2f8e049ea64325e1a
['ed1d182930db4c0b9269abc564c0d841']
Ok. I understand what natural means in this context. It appears to me from your answer that the diagram on the top of page 37 indeed comes from naturality. But I do not understand where do we get a map $A^* \rightarrow A $. I know we do have the snake lemma map $H^i(G,A^*) \rightarrow H^{i+1}(G,A) $
bf6b59d459e57b9a39e0b87a8a86f3f9be575b37d421f655d7aeb9de33e02c69
['ed1d6ffdaded49d084dc460216fa8a93']
protected void btnSubmit_Click(object sender, EventArgs e) { String conString = @"Data Source=<IP_ADDRESS><PHONE_NUMBER>;Initial Catalog=RecruitPursuit;Persist Security Info=True;User ID=RecruitPursuit;Password=Recruit20!8"; SqlConnection con = new SqlConnection(conString); //create a command behavior object String cmdString = "INSERT INTO [Positions]( Sport_ID, Position)" + "VALUES (@Sport_ID, @Position1), (@Sport_ID, @Position2), (@Sport_ID, @Position3), (@Sport_ID, @Position4), (@Sport_ID, @Position5), (@Sport_ID, @Position6), (@Sport_ID, @Position7), (@Sport_ID, @Position8), (@Sport_ID, @Position9), (@Sport_ID, @Position10), (@Sport_ID, @Position11), (@Sport_ID, @Position12), (@Sport_ID, @Position13), (@Sport_ID, @Position14), (@Sport_ID, @Position15), (@Sport_ID, @Position16), (@Sport_ID, @Position17), (@Sport_ID, @Position18), (@Sport_ID, @Position19), (@Sport_ID, @Position20), (@Sport_ID, @Position21), (@Sport_ID, @Position22), (@Sport_ID, @Position23), (@Sport_ID, @Position24), (@Sport_ID, @Position25), (@Sport_ID, @Position26), (@Sport_ID, @Position27), (@Sport_ID, @Position28), (@Sport_ID, @Position29), (@Sport_ID, @Position30)"; SqlCommand cmd = new SqlCommand(cmdString, con); SqlParameter param0 = new SqlParameter(); param0.ParameterName = "@Sport_Id"; param0.Value = Session["SportID"]; cmd.Parameters.Add(param0); cmd.Parameters.AddWithValue("@Position1", String.IsNullOrWhiteSpace(TextBoxOpt1.Text) ? (object)DBNull.Value : (object)TextBoxOpt1.Text); cmd.Parameters.AddWithValue("@Position2", String.IsNullOrWhiteSpace(TextBoxOpt2.Text) ? (object)DBNull.Value : (object)TextBoxOpt2.Text); cmd.Parameters.AddWithValue("@Position3", String.IsNullOrWhiteSpace(TextBoxOpt3.Text) ? (object)DBNull.Value : (object)TextBoxOpt3.Text); cmd.Parameters.AddWithValue("@Position4", String.IsNullOrWhiteSpace(TextBoxOpt4.Text) ? (object)DBNull.Value : (object)TextBoxOpt4.Text); cmd.Parameters.AddWithValue("@Position5", String.IsNullOrWhiteSpace(TextBoxOpt5.Text) ? (object)DBNull.Value : (object)TextBoxOpt5.Text); cmd.Parameters.AddWithValue("@Position6", String.IsNullOrWhiteSpace(TextBoxOpt6.Text) ? (object)DBNull.Value : (object)TextBoxOpt6.Text); cmd.Parameters.AddWithValue("@Position7", String.IsNullOrWhiteSpace(TextBoxOpt7.Text) ? (object)DBNull.Value : (object)TextBoxOpt7.Text); cmd.Parameters.AddWithValue("@Position8", String.IsNullOrWhiteSpace(TextBoxOpt8.Text) ? (object)DBNull.Value : (object)TextBoxOpt8.Text); cmd.Parameters.AddWithValue("@Position9", String.IsNullOrWhiteSpace(TextBoxOpt9.Text) ? (object)DBNull.Value : (object)TextBoxOpt9.Text); cmd.Parameters.AddWithValue("@Position10", String.IsNullOrWhiteSpace(TextBoxOpt10.Text) ? (object)DBNull.Value : (object)TextBoxOpt10.Text); cmd.Parameters.AddWithValue("@Position11", String.IsNullOrWhiteSpace(TextBoxOpt11.Text) ? (object)DBNull.Value : (object)TextBoxOpt11.Text); cmd.Parameters.AddWithValue("@Position12", String.IsNullOrWhiteSpace(TextBoxOpt12.Text) ? (object)DBNull.Value : (object)TextBoxOpt12.Text); cmd.Parameters.AddWithValue("@Position13", String.IsNullOrWhiteSpace(TextBoxOpt13.Text) ? (object)DBNull.Value : (object)TextBoxOpt13.Text); cmd.Parameters.AddWithValue("@Position14", String.IsNullOrWhiteSpace(TextBoxOpt14.Text) ? (object)DBNull.Value : (object)TextBoxOpt14.Text); cmd.Parameters.AddWithValue("@Position15", String.IsNullOrWhiteSpace(TextBoxOpt15.Text) ? (object)DBNull.Value : (object)TextBoxOpt15.Text); cmd.Parameters.AddWithValue("@Position16", String.IsNullOrWhiteSpace(TextBoxOpt16.Text) ? (object)DBNull.Value : (object)TextBoxOpt16.Text); cmd.Parameters.AddWithValue("@Position17", String.IsNullOrWhiteSpace(TextBoxOpt17.Text) ? (object)DBNull.Value : (object)TextBoxOpt17.Text); cmd.Parameters.AddWithValue("@Position18", String.IsNullOrWhiteSpace(TextBoxOpt18.Text) ? (object)DBNull.Value : (object)TextBoxOpt18.Text); cmd.Parameters.AddWithValue("@Position19", String.IsNullOrWhiteSpace(TextBoxOpt19.Text) ? (object)DBNull.Value : (object)TextBoxOpt19.Text); cmd.Parameters.AddWithValue("@Position20", String.IsNullOrWhiteSpace(TextBoxOpt20.Text) ? (object)DBNull.Value : (object)TextBoxOpt20.Text); cmd.Parameters.AddWithValue("@Position21", String.IsNullOrWhiteSpace(TextBoxOpt21.Text) ? (object)DBNull.Value : (object)TextBoxOpt21.Text); cmd.Parameters.AddWithValue("@Position22", String.IsNullOrWhiteSpace(TextBoxOpt22.Text) ? (object)DBNull.Value : (object)TextBoxOpt22.Text); cmd.Parameters.AddWithValue("@Position23", String.IsNullOrWhiteSpace(TextBoxOpt23.Text) ? (object)DBNull.Value : (object)TextBoxOpt23.Text); cmd.Parameters.AddWithValue("@Position24", String.IsNullOrWhiteSpace(TextBoxOpt24.Text) ? (object)DBNull.Value : (object)TextBoxOpt24.Text); cmd.Parameters.AddWithValue("@Position25", String.IsNullOrWhiteSpace(TextBoxOpt25.Text) ? (object)DBNull.Value : (object)TextBoxOpt25.Text); cmd.Parameters.AddWithValue("@Position26", String.IsNullOrWhiteSpace(TextBoxOpt26.Text) ? (object)DBNull.Value : (object)TextBoxOpt26.Text); cmd.Parameters.AddWithValue("@Position27", String.IsNullOrWhiteSpace(TextBoxOpt27.Text) ? (object)DBNull.Value : (object)TextBoxOpt27.Text); cmd.Parameters.AddWithValue("@Position28", String.IsNullOrWhiteSpace(TextBoxOpt28.Text) ? (object)DBNull.Value : (object)TextBoxOpt28.Text); cmd.Parameters.AddWithValue("@Position29", String.IsNullOrWhiteSpace(TextBoxOpt29.Text) ? (object)DBNull.Value : (object)TextBoxOpt29.Text); cmd.Parameters.AddWithValue("@Position30", String.IsNullOrWhiteSpace(TextBoxOpt30.Text) ? (object)DBNull.Value : (object)TextBoxOpt30.Text); int added = 0; try { con.Open(); added = cmd.ExecuteNonQuery(); } catch (Exception err) { // Output.Text = err.Message; } finally { con.Close(); } Response.Redirect("Questionnaire.aspx"); }
d895527c73793d378409c24de94366dae941fc91bc7c10d8ced26cecd2b841b0
['ed1d6ffdaded49d084dc460216fa8a93']
I have 30 textboxes available for user input and a Submit button that needs to insert only the textboxes with values. Currently, I have the empty text boxes receiving a "null" value, but this inserts the word "null" into the database instead of leaving it empty. protected void btnSubmit_Click(object sender, EventArgs e) { String conString = @"Data Source=<IP_ADDRESS><PHONE_NUMBER>;Initial Catalog=RecruitPursuit;Persist Security Info=True;User ID=RecruitPursuit;Password=Recruit20!8"; SqlConnection con = new SqlConnection(conString); //create a command behavior object String cmdString = "INSERT INTO [Positions]( Sport_ID, Position)" + "VALUES (@Sport_ID, @Position1), (@Sport_ID, @Position2), (@Sport_ID, @Position3), (@Sport_ID, @Position4), (@Sport_ID, @Position5), (@Sport_ID, @Position6), (@Sport_ID, @Position7), (@Sport_ID, @Position8), (@Sport_ID, @Position9), (@Sport_ID, @Position10), (@Sport_ID, @Position11), (@Sport_ID, @Position12), (@Sport_ID, @Position13), (@Sport_ID, @Position14), (@Sport_ID, @Position15), (@Sport_ID, @Position16), (@Sport_ID, @Position17), (@Sport_ID, @Position18), (@Sport_ID, @Position19), (@Sport_ID, @Position20), (@Sport_ID, @Position21), (@Sport_ID, @Position22), (@Sport_ID, @Position23), (@Sport_ID, @Position24), (@Sport_ID, @Position25), (@Sport_ID, @Position26), (@Sport_ID, @Position27), (@Sport_ID, @Position28), (@Sport_ID, @Position29), (@Sport_ID, @Position30)"; SqlCommand cmd = new SqlCommand(cmdString, con); //This is only an example using 5 positions. SqlParameter param0 = new SqlParameter(); param0.ParameterName = "@Sport_Id"; param0.Value = Session["SportID"]; cmd.Parameters.Add(param0); SqlParameter param1 = new SqlParameter(); param1.ParameterName = "@Position1"; param1.Value = TextBoxOpt1.Text; cmd.Parameters.Add(param1); SqlParameter param2 = new SqlParameter(); param2.ParameterName = "@Position2"; if (TextBoxOpt2.Text != String.Empty) { param2.Value = TextBoxOpt2.Text; } if (TextBoxOpt2.Text == String.Empty) { param2.Value = "null"; //cmd.Parameters.AddWithValue("@Position2", param2==null ? (object)DBNull.Value : param2); } cmd.Parameters.Add(param2); SqlParameter param3 = new SqlParameter(); param3.ParameterName = "@Position3"; if (TextBoxOpt3.Text != String.Empty) { param3.Value = TextBoxOpt3.Text; } if (TextBoxOpt3.Text == String.Empty) { param3.Value = "null"; } cmd.Parameters.Add(param3); SqlParameter param4 = new SqlParameter(); param4.ParameterName = "@Position4"; param4.Value = TextBoxOpt4.Text; if (TextBoxOpt4.Text != String.Empty) { param4.Value = TextBoxOpt4.Text; } if (TextBoxOpt4.Text == String.Empty) { param4.Value = "null"; } cmd.Parameters.Add(param4); SqlParameter param5 = new SqlParameter(); param5.ParameterName = "@Position5"; param5.Value = TextBoxOpt5.Text; if (TextBoxOpt5.Text != String.Empty) { param5.Value = TextBoxOpt5.Text; } if (TextBoxOpt5.Text == String.Empty) { param5.Value = "null"; } cmd.Parameters.Add(param5); }
f44c9247b806bea1b2a9850dfa7e03af2392974dd476bd692c2ceb6c6216e340
['ed23c00dd8ad4bbeac9e395b898c3502']
It's a general trend that basicity of oxides decreases down the group. But recently I came across a statement "the basicity of second group oxide decreases down the group and decrease in basic nature of oxide from Be to Ba is due to decrease in polarizing power with increase in ionic size" I'm not able to understand the relationship between ionic nature and basicity. Also I feel that more the ionic nature, more the basicity, (as oxygen easily dissociates ) This is question is related to this , but generalised explaination is given, I'm looking for specific explaination to this this particular case
9de08b75b7030d6757fa5ee32b359494892c8dff49d766a2fc5c9b966739b965
['ed23c00dd8ad4bbeac9e395b898c3502']
@DiogoGomes no problem, just hope to find someone here that can help or if they know of ways to fully export everything from Vivaldi so that i can just reinstall the system or if they know of other ways to list all installed apps that is as elegant as dash, i'll take it
3cd4959f279ae50ed3b1e5761da5a8c9e7a910f56294d176bbd7939c982de7dd
['ed3012fba8394d06a185886103b40963']
I had this problem some time ago and after some digging I found out that my concern files where named using the Capitalize form (for some crazy reason). So I renamed them from Searchable.rb to searchable.rb and it's all done! :) PS. IF you use git/github, the diff isn't case sensitive so if you rename them from Levelable.rb to levelable.rb it won't appear in the git status. Cheers
6bf758933943e212e507fc020070df9154294e51764bc692137cf115cd24b183
['ed3012fba8394d06a185886103b40963']
You are overriding the bootstrap css, which is ok, but you have to be careful with it, look at your stylesheet.css at line 28: .navbar ul>li { float: left; display: inline; } and on your line 35: .navbar ul>li>a { color: #A4ABB0; padding: 42px 29px 23px 29px; text-decoration: none; text-transform: uppercase; font-weight: bold; border-bottom: 5px solid #FFFFFF; } those styles are ALWAYS been applied to your .navbar, and because of that your "mobile navbar" (ie. XS ans SM) is having this wrong behaviour. You can add some media queries to fix it, so you can apply diference style roles to your navbar, depending on your display size. Some media query example: @media(max-width: 767px){ .navbar ul>li { // your css to make your collapsed menu works as you wish // just remove your float and it will shows as a list // and not in a row } .navbar ul>li a { // display block, small padding should works too display: block; padding: 15px 29px 5px 29px; } .navbar ul { // also set you ul to display block so your list be get 100% width display: block; } } you can use more than one media query, so you just need to be creative :)
1d8fb68671fc7797fe01218881f9d2d54473464d87b5dc5a313d0b65fd6db137
['ed32329c1b48449f98a8f48aba83180f']
I'm facing an issue with libxml2 (version <IP_ADDRESS>). I'm attempting to dump a node while parsing an in-memory document with a xmlTextReaderPtr reader. So upon parsing the given node, I use xmlNodeDump() to get its whole content, and then switch to the next node. Here is how I proceed: [...] // get the xmlNodePtr from the text reader node = xmlTextReaderCurrentNode(reader); // allocate a buffer to dump into buf = xmlBufferCreate(); // dump the node xmlNodeDump(buf, node->doc, node, 0 /* level of indentation */, 0 /* disable formatting */); result = strdup((char*)xmlBufferContent(buf)); This works in most cases, but sometimes the result is missing some children from the parsed node. For instance, the whole in-memory xml document contains [...] <aList> <a> <b>42</b> <c>aaa</c> <d/> </a> <a> <b>43</b> ... </aList> and I get something like: <aList> <a> <b>42</b> </c> </a> </aList> The result is well formed but it lacks some data ! A whole bunch of children has "disappeared". xmlNodeDump() should recursively dumps all children of . It looks like some kind of size limitation. I guess I do something wrong, but I can't figure out what. Thank you for your answers.
f5cac932acdc26f281b06dbfefc0e228ad1fb4ebf708d853d8eff2cdaace8cba
['ed32329c1b48449f98a8f48aba83180f']
Vim is not autoindenting the C source files I am working on, although it claims both the autoindent and cindent options are enabled when I type the :set command. Nothing is happening when I type in some code. For instance writing int main() { return 0; } the "return 0;" statement stays on the left. However if I type the "=G" command, my file gets indented. Here is my config: ubuntu 13.04 vim 7.3.547 + vim-scripts vimrc is splitted into /etc/vim/vimrc and ~/.vimrc. The concatanated content is as follow: runtime! debian.vim if has("syntax") syntax on endif set background=dark " Uncomment the following to have Vim jump to the last position when " reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif if has("autocmd") filetype plugin indent on endif set showcmd set showmatch if filereadable("/etc/vim/vimrc.local") source /etc/vim/vimrc.local endif """"""" now this is ~/.vimrc """"" set runtimepath+=,/usr/share/vim-scripts set autoindent set noexpandtab " create ~<file> when saving modifications to <file> set backup " preserve source's format when pasting set paste " disable mouse usage set mouse= " colors set t_Co=256 colorscheme mustang set hlsearch set number set cursorline if has("statusline") hi User1 ctermbg=red cterm=bold,reverse hi User2 ctermbg=darkblue cterm=bold,reverse hi User3 ctermbg=darkred cterm=bold,reverse hi User4 ctermbg=brown cterm=bold,reverse set laststatus=2 set statusline=%h%f\ %y\ %1*%r%*%1*%m%*%=[col:%2*%c%*]\ [line:%3*%.6l%*/%4*%.6L%*\ -\ %p%%] endif set spellsuggest=5 match Error /\s\+$/ Do you have any idea ? Thank you very much for your help. <PERSON>
1ae7157334d61d30fdc33bde5e66c318a407fb70e07597755fb901007c23963f
['ed3c3ef6af354e71adde1618646c2431']
I'm not sure whether this is the correct site to ask this question, but why does it sometimes (game-specific, usually) take really long to enter / exit a fullscreen game (black screen for ~1-5s)? And why don't we have these problems for example when entering a Windows 8 fullscreen app?
8daa689289cea1bb32a24a7892a61303a57005f013c4d4b6f4d2debd90c03395
['ed3c3ef6af354e71adde1618646c2431']
On my page visualforce page I have a few fields that on submit validation will run. For some reason the error is not displaying under the textarea but its working for other fields on my page. How can I solve this? The errorMsg class is not being applied to the textarea On my visualforce page I have this <div class="form-group col-sm-12"> <apex:outputLabel value=" {!$ObjectType.Employment_History__c.fields.Job_description__c.label}" styleClass="control-label"/> <apex:inputTextarea value="{!emp.Job_description__c}" styleClass="form- control" /> </div> In my controller I am just checking if the field is blank if so display the error message that's stored in a custom label. if (String.isBlank(emp.Job_description__c)){ emp.Job_description__c.addError(System.Label.Validation EmploymentDescription); doNotsubmit = true; }
9c398fbee847535b5de904d5d77238700c4e47c0d7f9fd1101b55d1956eb4171
['ed3ed45698da42018338c4936a3bd6e8']
@ <PERSON>, it's so strange that after setting fcitx as your keyboard input method system, after changing schema file with glib-compile, when 'dpkg -i' was typed, error occurred again. And the schema file was changed as original 'Gtk/IMModule=fcitx'. Do you know what happened ? Thanks for your response.
dfcaf767f099d2a90559dc2033efef0dfb776c6fa0f2f10d31a4461965fdd16c
['ed3ed45698da42018338c4936a3bd6e8']
@Parto No, but 'dpkg error' issue seams have no affect on my using. As the answer said, the package ubuntu provides has not included the lib and include files at all. It's quite drama, and I felt guilty about your offering of the bounty. After all, I installed it through source code and it works.
58eb54d35e3d9be196c4cd46368a2d602f0c4edb185166e62a2fd34a78d8340f
['ed4203b6137940e9a34955a8eed7e1c1']
Is it possible to set the same sesion_id everytime before session_start even after the session has expired? I want to have the same session id for a user each time he logins for some testing purpose. This is how i do it. session_id($myid); session_start(); if(isset($_SESSION['something'])) { // do something } else { // set the same variables again depending on some condition }
25dc8724cc8c7bb33df89ae43543fbe215fe71ab080d232ddf52c42c0a76caa3
['ed4203b6137940e9a34955a8eed7e1c1']
I am working on an html5 mobile app for a website. The website contains a lot of gifs(about 5-10 per page) on its pages which are making the app events, scroll, drag, css animations, and everything very slow. if i get rid of the gifs the app runs fine. I have tested the app on both android(nexus 7) and ios(iphone 5 and ipad 4). I was thinking of showing a still image and then play it on some event, but it was spoiling the webpage's idea.I am using the mosync sdk for development. Any suggestions on what can i do to not make it slower?
900ac010ebe3f6c7c4d86f36b4c46e491a4fe227c2a9a4708846c101540db8d5
['ed4dfacf02274734b452580a4ab51189']
I am writing code to allow a user to reset their password using Firebase. Currently, if the ask to reset their password, I use the sendPassword Reset button as follows: @IBAction func sendConfirmationEmail(_ sender: Any) { if let email = email { auth.sendPasswordReset(withEmail: email, completion: { error in if let error = error { // Handle errors } }) } } This successfully sends the verification email. I then click the link in the email, which takes me to a webpage where I can enter a new password and click submit. The page then tells me I can sign in using my new password. However, I would like to have the user enter their new password in my app. Ideally, when the user clicks the link, they will be redirected to my app and I can segue to the correct screen, where they can then enter a new password and then I can call the updatePassword firebase function. If this is not possible, I would at least like to have the user automatically redirected to the app upon submitting their new password. I have explored doing this with actionCodeSettings, but I do not want to write my own webpage for entering a new password.
3855c5922c9ec51926e96cce7c114b51c9dca4ebe3c591b0ad57353be9d4666a
['ed4dfacf02274734b452580a4ab51189']
I am attempting to use NSArrays and NSPredicates to filter certain cells of a UITableView. I have a TableViewController class called FilterTable that is made up of FilterCell, which is a subclassed UITableViewCell. The data in a filter cell comes from a UserProfile, which has a property "major". When the user clicks a button, I want the table to show only the cells that correspond to users that have Computer Science as their major. I made an NSPredicate to filter the array of UserProfile that I use to populate my table, but when I do this I get the error *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key major.' However, as I said major is a property of UserProfile. Other fixes to keyvalue compliancy issues suggest that outlets are not connected correctly in interface builder. However, UserProfile is not directly shown on FilterTable and is therefore not connected through IB, nor do I want it to be. Instead FilterTable has an array of UserProfiles which it uses to populate FilterCells. I also tried linking the FilterCell to FilterTable and then I could access the label corresponding to major, but that gave me an error that you cannot make an outlet to repeating content. // FROM FilterTable: ... let predicate = NSPredicate(format: "major = 'Computer Science'") filteredProfiles = (userProfilesArray as NSArray).filtered(using: predicate) as NSArray ... // FROM UserProfile class UserProfileViewController: UIViewController { var major: String! ...
079559c69d78df0843a7f6b60f602f77b28bc4963a58e139a3c61218556d795f
['ed520a373cf9411195a4d4d388ef12ba']
If you are using more than one item in your form, I would suggest using var data = $('form').serialize(); This will pass all of the form values to your php script and then you can use php to insert them. $("#apply").click(function(e) { e.preventDefault(); var oppid = "<?echo $opportunity->id;?>"; var data = $('form').serialize(); $.ajax({ url: "https://MYSITEHERE/submitapplication", method: "POST", data: {formdata:data}}); }); You would then just parse the data in your php
78bff015f11bed4f3d0f013cd9c46b068e9dc6224977cd8d96ba3098638b3403
['ed520a373cf9411195a4d4d388ef12ba']
I dont think you will need to necessarily worry about getting the text from the body to put into the database, I would personally store the answer in another table, but referencing the original questions. So the table could be: (id, answer, userid, opportunityid) values (1, 'Yes i have', '1', '12'); or something like that You could then pull the values from the database after would and put it all together at the end. The benefit of this is that you are storing less information in your database, so the database will not be as big (less data duplication) Once all of the questions have been answered then you can write a script to put it all together. Or even have a function to put what has been completed together as you go. Does that make sense? I would be happy to provide more clarification.
89b122fcaa477087ea0a87599ed91c07176b2b23cd063e33efd26055e33b85aa
['ed5e84e443d34a098534277a5fed3be2']
Simple question really, but I'm very confused by the starting point. Let's assume that we have a portfolio whose excess returns can be described by the following equation from the single index model: E(R) = .04 + 1.4*(Risk Premium of the Market) Obviously, alpha is .04, beta is 1.4. This portfolio is underpriced, as it lies outside the Security Market Line and has a positive alpha. Now, if I wanted to exploit this and earn that .04 alpha, I understand I'd create some sort of tracking portfolio to mimic the 1.4 beta. This is where I'm confused, I see these questions and they state that we'd borrow .4 at the risk free rate and buy a portfolio with 1.4 beta. This is where all my questions start. How does this make any sense?? Firstly, what's the base assumption of how much money we have? 1 unit? This means 1 unit lets us buy a portfolio of beta = 1? If we borrow .4 at the risk-free rate, how does that allow us to buy a 1.4 beta portfolio (doesn't this assume price is strictly proportional to beta and NOTHING else?) Any insight would be very much appreciated.
f6884c1eb69a857f35b273f272af019c107022b75873ab6202965c5c6cca2b3e
['ed5e84e443d34a098534277a5fed3be2']
By code, when a hole is drilled to run a wire or pipe through a wood member (stud, plate, etc.), if there is less than 1.5" of wood between the face of stud and edge of hole, a nail plate (made of steel) must be used to protect the wire/pipe from unnecessarily long fasteners. Use a screw that will not penetrate into the wall more than two inches (1.5" of wood plus 1/2" drywall). As far as between the studs, drill as small hole only the depth of the drywall, then use a piece of wire or tip of a screwdriver to 'feel' for a wire or pipe directly behind the hole.
bc8cc46e355a741f8a303aa1b29c28b88975be414920979f0531518253398161
['ed67e21fac0749329068156597d0090c']
I think this is what you are interested in. Python provide direct methods to find permutations. These methods are present in itertools package. Import itertools package to implement permutations method in python. This method takes a list as an input and return an object list of tuples. # import itertools from itertools import permutations # Get all permutations of ['a', 'b', 'c'] perm = permutations(['a', 'b', 'c']) # Print the obtained permutations for i in list(perm): print i Let's say you want to get permutations of length n (say n = 2) then,all you have to do is, #change perm = permutations(['a', 'b', 'c']) #to perm = permutations(['a', 'b', 'c'],2)
a6fb0a6affc3b6c8c81faf4255860ecbbdf68424eb7d81430b2ea5db02702511
['ed67e21fac0749329068156597d0090c']
One solution is to kill the port that is already in use and reuse it again. To a kill a specific port in Linux use below command: sudo fuser -k Port_Number/tcp eg: In your case it would be as follow: sudo fuser -k 98/tcp But to answer your question, I think the below code will help you to find all free tcp port: from contextlib import closing import socket for port in range(1, 8081): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: res = sock.connect_ex(('localhost', port)) if res == 0: print (port)
045c03b34dce7a7a443a0c3478c3742e8354c38de1291180ca6429686b732430
['ed70bac299c346d591ce9d01baf127e5']
While reading this answer, I came across the two different events Application.Current.Dispatcher.UnhandledException and Application.Current.DispatcherUnhandledException and I was wondering what the difference between those two are. My guess is that Application.Current.DispatcherUnhandledException is kind of a wrapper for the Application.Current.Dispatcher.UnhandledException, but this is only a gut feeling and I'm very uncertain. Does it make any difference (for single-threaded or multi-threaded applications)?
eaa84cdabc8219e8390eeaf6168b958f8ef8ee06bcff1abdf8a31aa123c439e3
['ed70bac299c346d591ce9d01baf127e5']
If you have the MySqlDataAdapter, try if the following code works for you: string connectionstring = @"****;userid=*****; password=***;database=***"; cnn = new MySqlConnection(connectionstring); cnn.Open(); string query_date = "SELECT computer_name AS `computer_name` FROM wp_users WHERE user_login = @login"; MySqlCommand command2 = new MySqlCommand(query_date, cnn); command2.Parameters.AddWithValue("@login", metroTextBox.Text); DataTable table = new DataTable("ResultTable"); MySqlDataAdapter adapter = new MySqlDataAdapter(command2); adapter.Fill(table); // This is the important line string result = table["computer_name"]; cnn.Close();
1dd94cdd92eeacfe89da67174a80fcff4caa5e189b15114c842cebece9714eec
['ed76f348a3b84412baf81dbd1f759735']
I have searched a lot on the website, but didn't find any related question. So I believe it is not a duplicate. I know we can initialize an array with 3 ways: char[ ] charAr=new char[10]; char[ ] charAr={'a', 'b', 'c'}; char[ ] charAr=new char[]{'a','b','c'}; 1st question is: what is the name of {'a','b','c'} kind of stuff? Is it called array literals? 2nd question is: what is the difference between new char[]{'a','b','c'} with {'a','b','c'}? 3rd question is: why I can't return a newly created array with {'a','b','c'}? I have to return new char[]{'a','b','c'}. 4th question: both new char[10] and new char[]{'a','b','c'} are constructors of array, right?
e1b7a9a75d92aab8c8ecc0bd3f6e8dc38bc2877231e666f7400e96da8ddd0937
['ed76f348a3b84412baf81dbd1f759735']
I have been confused for the words "dynamic" and "static" for a while. As I know, in different scenarios, they may have different meanings. Anyone can help me make it clear. I hope the explanations will be focused in Java. Thanks in advance! Scenario 1: what does that mean when they are applied to data structures,like arrays? People usually regard linkedlist as dynamic and arrays as static. Why? And sometimes arrays could be either static(in stack) or dynamic(in heap). Why this happens? Scenario 2: what does that mean when they are applied to memory? Why stack is static and heap is dynamic? Scenario 3: what does that mean when they are applied to dynamic programming? is there such a thing called static programming?
8d49f9d8a93a1d72718d67b785c3d3cb7c6dd9d6d36f03d3a75ed9f8491331ea
['ed96857822fb4adda474d5ed8849f714']
You can add a "st_url" Parameter to specify the shared url. Insert the current url without the page-parameter to share the same url across multiple pages. <span class='st_fblike_hcount' st_url='http://www.example.com/seo_quotes_archive.php' displayText='Facebook Like'></span> Source: http://support.sharethis.com/customer/portal/articles/475079-share-properties-and-sharing-custom-information#sthash.EoamLhNZ.dpbs
e8f84654cfce7bb40a2c92a448449d9b5e88585897b6f737690d899864eb62be
['ed96857822fb4adda474d5ed8849f714']
Is it possible to find out which constant has been passed as an argument? Example <?php define( 'POINTS_REQUEST_ADD', '3' ); define( 'POINTS_REQUEST_DONE', '5' ); define( 'POINTS_REQUEST_REACTIVATE', '1' ); define( 'POINTS_REQUEST_UPLOAD', '3' ); public static function addPoints( $points ) { switch($points) { case POINTS_REQUEST_ADD: ;// code case POINTS_REQUEST_DONE: ;// code // .... } } } addPoints(POINTS_REQUEST_ADD); In this case $points only contains the value (1, 3 or 5) and I can't think of any way to get the correct constant name out of it. if the value is 3 it could be POINTS_REQUEST_ADD or POINTS_REQUEST_UPLOAD.
a4457b4e55154156dc3c1d9c6ca7a75c34c2b44f70762fdc53d961ba00a0f85e
['edae5a25397f4f95b00ae0431202a335']
I have a python function that needs to write an arbirary number of bytes to a bus: def Writebytes(self,values): for byte in values: self.writebyte(byte) The idea is you pass it a list of bytes and it writes them all out to the bus, e.g. data=[0x10,0x33,0x14] object.Writebytes(data) i'd like to support a single byte write without the [ ] so that you can enter: data=0x00 object.Writebytes(data) the aim to be to ease usage. However you cannot iterate over the int that is passed to Writebytes. Is there a simple way to coerce the input to always be a list? (preferably in the function definition..) All this iterables stuff is new to me in my first week of Python (which has gone quite well actually, to python's credit). I'm using Python3 mostly on an RPi btw.. Many thanks!
debd20f942d7b3724728196bee550431f98724957cb23eae9dc55aa63c5397d6
['edae5a25397f4f95b00ae0431202a335']
I'm having trouble with inherited methods in a class definitions in the Arduino environment. I have a base class portal which is inherited from by class gauge and then meter inherits from gauge. The base class has a definition for a method, but the compiler says it cant find a definition of meter::method. Header file: #ifndef UIelements_h #define UIelements_h #include "Arduino.h" #include "UTFT.h" #include "URTouch.h" #include "UTFT_Geometry.h" class portal { public: UTFT* myDisplay; int origin[2]={0,0}; int portalSize[2]={10,10}; int BGColor=VGA_BLACK; int borderSize=1; int borderColour=VGA_WHITE; portal(); portal(UTFT* myDisplay); void draw(void); void drawContents(void); private: bool firstdraw=true; }; class guage :public portal { public: UTFT_Geometry* myGeometry; float scaleMin=0.0; float scaleMax=100.0; float tick=20; bool logScale=false; int scaleColour=VGA_WHITE; int foreColour=VGA_YELLOW; float redBegin=80.0; int redColour=VGA_RED; float value=0; float lastValue=0; guage(); guage(UTFT*,UTFT_Geometry*); void setNewValue(float); }; class <PERSON><IP_ADDRESS>method. Header file: #ifndef UIelements_h #define UIelements_h #include "Arduino.h" #include "UTFT.h" #include "URTouch.h" #include "UTFT_Geometry.h" class portal { public: UTFT* myDisplay; int origin[2]={0,0}; int portalSize[2]={10,10}; int BGColor=VGA_BLACK; int borderSize=1; int borderColour=VGA_WHITE; portal(); portal(UTFT* myDisplay); void draw(void); void drawContents(void); private: bool firstdraw=true; }; class guage :public portal { public: UTFT_Geometry* myGeometry; float scaleMin=0.0; float scaleMax=100.0; float tick=20; bool logScale=false; int scaleColour=VGA_WHITE; int foreColour=VGA_YELLOW; float redBegin=80.0; int redColour=VGA_RED; float value=0; float lastValue=0; guage(); guage(UTFT*,UTFT_Geometry*); void setNewValue(float); }; class meter :public guage { public: float startAngle=-40.0; float endAngle=40.0; float scaleRadius=80.0; meter(); meter(UTFT*,UTFT_Geometry*); void setValueAndDraw(float); private: void PointerDraw(float); }; .cpp #include "Arduino.h" #include "UIelements.h" portal<IP_ADDRESS>portal() { } portal<IP_ADDRESS>portal(UTFT* UTFT) { // constructor: save the passed in method pointers for use in the class myDisplay=UTFT; } void portal<IP_ADDRESS>draw(void) { // draw the contents if (firstdraw) { // draw background and border } else { drawContents(); } } void portal<IP_ADDRESS>drawContents(void) { //portal class has no contents to draw, but subclasses will have.. } ... meter<IP_ADDRESS>meter(UTFT* UTFT,UTFT_Geometry* Geometry) { // constructor save the passed in method pointers for use in the class myDisplay=UTFT; myGeometry=Geometry; } void meter<IP_ADDRESS>setValueAndDraw(float newValue) { setNewValue(newValue); draw(); } void meter<IP_ADDRESS>drawContents(void) { float xcentre=origin[1]+portalsize[1]/2; float ycentre=origin[2]+portalSize[2]-1; if (firstdraw=true) //...more code in here.. } error message error: no 'void meter<IP_ADDRESS>drawContents()' member function declared in class 'meter' I've asked a couple of people but everyone seemed to think that the class inheritance looked OK - is this an Arduino thing, or is there something fundamental that I don't understand? Any help gratefully received. I fear that its some silly typo or omission of ; etc.
f6363087d0b2aa7d26824b9e73b7a672cb56addbf4b22f29dc006a2c129a6327
['edaf14de45d74ecf929e6745ceb5bad3']
I went through Dask tutorials and they always start with the initialization of the Client: from dask.distributed import Client client = Client(n_workers=4) I am mostly interested in using Dask's read_csv function for reading DataFrames in parallel on my laptop. import dask.dataframe as dd df = dd.read_csv('trainset.csv').compute() Despite setting n_workers=4, Dask uses all the cores when reading csv. It is the same if initialize the Client or not. Do I even need to initialize the Client when I using Dask locally and only for reading files? Is it initialized implicitly with Dask?
3a4f21be93bc1c802932c081227b86bbb31a5fec395f01227d15753dccb70813
['edaf14de45d74ecf929e6745ceb5bad3']
If you have a pandas Dataframe you can use this template to plot two lines with different axis: from bokeh.plotting import figure, output_file, show from bokeh.models import LinearAxis, Range1d import pandas as pd # pandas dataframe x_column = "x" y_column1 = "y1" y_column2 = "y2" df = pd.DataFrame() df[x_column] = range(0, 100) df[y_column1] = pd.np.linspace(100, 1000, 100) df[y_column2] = pd.np.linspace(1, 2, 100) # Bokeh plot output_file("twin_axis.html") y_overlimit = 0.05 # show y axis below and above y min and max value p = figure() # FIRST AXIS p.line(df[x_column], df[y_column1], legend=y_column1, line_width=1, color="blue") p.y_range = Range1d( df[y_column1].min() * (1 - y_overlimit), df[y_column1].max() * (1 + y_overlimit) ) # SECOND AXIS y_column2_range = y_column2 + "_range" p.extra_y_ranges = { y_column2_range: Range1d( start=df[y_column2].min() * (1 - y_overlimit), end=df[y_column2].max() * (1 + y_overlimit), ) } p.add_layout(LinearAxis(y_range_name=y_column2_range), "right") p.line( df[x_column], df[y_column2], legend=y_column2, line_width=1, y_range_name=y_column2_range, color="green", ) show(p)
3a10123783c469ab0ff7ff8a3f47c6419c992b1316903ceb3c8bb3716ab1d702
['edb7dd88a9f8484d8716d3004651ac43']
Supposedly, TestNG creates failed.xml file under test-output->failed.xml but in my cases, the file is there but it's NOT showing correct failed test cases( correct XML test cases), It shows test cases that I had run sometime back. Please suggest what configuration I am missing so it can generate a failed.xml file every time I run my test cases.
b6858fcfff58fe3c882670a7b566789e9280325106493b7abd830e2395b23588
['edb7dd88a9f8484d8716d3004651ac43']
I am having the issue with the opening of android emulator thru appium. Here is error i am getting [BaseDriver] Creating session with MJSONWP desired capabilities: { [BaseDriver] "app": "/Users/MY_NAME/Downloads/ApiDemos-debug.apk", [BaseDriver] "appActivity": ".view.TextFields", [BaseDriver] "appPackage": "io.appium.android.apis", [BaseDriver] "automationName": "UiAutomator2", [BaseDriver] "deviceName": "Pixel 2", [BaseDriver] "platformName": "Android", [BaseDriver] "platformVersion": "10.0", [BaseDriver] "newCommandTimeout": 0, [BaseDriver] "connectHardwareKeyboard": true [BaseDriver] } [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [BaseDriver] connectHardwareKeyboard [BaseDriver] Session created with session id: ea88911e-0939-4cb0-b32c-22be3af1d405 [BaseDriver] Using local app '/Users/MY_NAME/Downloads/ApiDemos-debug.apk' [UiAutomator2] Checking whether app is actually present [ADB] Using 'adb' from '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb' [AndroidDriver] Retrieving device list [ADB] Trying to find a connected android device [ADB] Getting connected devices... [ADB] No connected devices have been detected [ADB] Could not find devices, restarting adb server... [ADB] Restarting adb [ADB] Killing adb server on port '5037' [ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server' [ADB] Getting connected devices... [ADB] No connected devices have been detected [ADB] Could not find devices, restarting adb server... [ADB] Restarting adb [ADB] Killing adb server on port '5037' [ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server' [ADB] Getting connected devices... [ADB] No connected devices have been detected [ADB] Could not find devices, restarting adb server... [ADB] Restarting adb [ADB] Killing adb server on port '5037' [ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server' [ADB] Getting connected devices... and at the end of the logs [ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server' [UiAutomator2] Deleting UiAutomator2 session [BaseDriver] Event 'newSessionStarted' logged at 1595922772048 (00:52:52 GMT-0700 (Pacific Daylight Time)) [MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device in 20288ms. [MJSONWP] at getDevices (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:211:13) [MJSONWP] at getDevices (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:224:18) [MJSONWP] at getDevices (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:224:12) Here is a screenshot of most of the configuration I can launch Android emulator thru android Studio without any issue Result from adb devices Terminal MY_NAME-Pro:~ MY_NAME$ adb devices List of devices attached emulator-5554 device
40a2c0587b73b966d0551e496dc024efe1c5bc19fbaaa72671fbfefa2f98fcc9
['edc52ff127104aa7b4faa555fef7c66f']
I am planning to develop a project which will have access to different services placed in different domains using ajax, so that it may get different types of data from each of them. At the beginning I thought that due to cross-site scripting that can't be done so I would have to use a different approach or maybe use a bridge (make the calls to my server which will behind the scenes call the others) but the bridge would become a performance issue. But then I was testing Angular using Google's API and realized that it just works. I mean, I could make AJAX calls to my localhost (though I know localhost may work just because it's localhost) using a script loaded from googleapis.com. Now I wonder if it is possible or not to have a page with ajax calls to other domains like: mail.mydomain.com, profiles.mydomain.com, media.mydomain.com, and so on. And if so, can that be done just like that or are there any limitations? Because I remember that some years ago I had trouble doing things like that due to the cross-script block. Just in case it helps, I'm planning to use Angular to get the data and paint it over the views. Thanks.
dea69a451b20ba8881aec6ef413ba784d0e98d809658da44966f3a50dcb6aca6
['edc52ff127104aa7b4faa555fef7c66f']
As no one is answering I'm going to say that I've found that adding these folders to the ones I had open to public seems to do the trick pretty well at the moment, maybe I will need to add something else in future but it seems to be working: <location path="umbraco"><system.web><authorization><allow users="?"/></authorization></system.web></location> <location path="umbraco_client"><system.web><authorization><allow users="?"/></authorization></system.web></location> <location path="DependencyHandler.axd"><system.web><authorization><allow users="?"/></authorization></system.web></location> I've added umbraco's folders and a virtual file named DependencyHandler.axd in the root. Though, if anyone knows a better solution don't hesitate to show it off, please.
ea57e751d3f6ad44b2c5e439f835d5a28e6e8897632e719e1dfb92ee2daa9a62
['edccd646dc724c0ab48c197569a269ce']
It's a shame I can't downvote or comment on the accepted answer. As per the doc's, what was written and accepted is simply untrue. Sass only removes single line codes and preserves multiline comments. Sass supports standard multiline CSS comments with /* */, as well as single-line comments with //. The multiline comments are preserved in the CSS output where possible, while the single-line comments are removed. See here for the docs.
44ce97dd15795a7bd1879b0ed0a0055577458624e00f3ae24e70ce3fe1986be8
['edccd646dc724c0ab48c197569a269ce']
You need to be a little more specific, i.e. what your current html and css is and and example link. A simple solution is to just float all 4 divs, giving them fixed width's and height's, clear the left float on the third div so that the final two divs drop down to the second line. You don't even have to clear the third div if you just set a 50% width on the divs but that's dependent on if you are using fixed width's and height's, i.e responsive sites shunn fixed width's.
4dcfd28f7e2c2295f2de4d9d07a76bfb036418327ee9bda47aa1882419c0b1a5
['edd01bfb077b4aa3a0b7f5c3da672331']
@MadProgrammer I modified a little bit based on your code. public String blowup(String str) { StringBuilder sb = new StringBuilder(); for(int i =0; i < str.length(); i++) { char c = str.charAt(i); if(Character.isDigit(c) && i < str.length()-1) { char next = str.charAt(i+1); if(!Character.isDigit(next)) { int repTimes = Integer.parseInt(Character.toString(c)); for(int k = 0; k < repTimes; k++) { sb.append(next); } } else { sb.append(c); } } else { sb.append(c); } } return new String(sb); }
b44017d3a94fc879c76cafc821e27fc4e10bbfaa447676fd790927d0f4eebaeb
['edd01bfb077b4aa3a0b7f5c3da672331']
I came across some C++ code from a blog. I tested the code in my IDE. The function in the code can work properly even without the return statement in the recursion calls(the search(head->lchild, x) and the search(head->rchild, x)); Can anyone explain why? Node* search(Node* head, int x){ if(head == NULL) return NULL; else if(x == head->key) return head; else if(x <= head->key) search(head->lchild, x); else search(head->rchild, x); }
012b7cfb62af8334528867d76d66fce4bd61b12f3e9e9c1692528d6e6bfa3220
['edeec787ed0441c28dd370a029c87b40']
This question has been asked many times before, but none of the answers helped in this case. The following occurs on the /api location. By default, Nginx is sending the 504 gateway timeout after one minute. We increased this timeout with proxy_connect_timeout, proxy_send_timeout, proxy_read_timeout, send_timeout and client_body_tiemout to ten minutes. Unfortunately requests still time out after two minutes with the same gateway timeout error. We also overwrote the connection header to avoid any issues with keep-alive, unfortunately, this didn't help either. Is there any other setting that might be limiting it to two minutes? location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://<IP_ADDRESS>:5000; proxy_redirect off; # Handle Web Socket connections proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; # proxy_set_header Connection "upgrade"; proxy_set_header Connection ""; proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600; client_body_timeout 600; location /api { proxy_pass http://<IP_ADDRESS>:5001; } }
3273e4d2e615dcab32b3a823ae9fea9687a32a434c75aa0cec021acb34f8569a
['edeec787ed0441c28dd370a029c87b40']
After nearly 3 hours of experimenting I got it and even 260 times faster as before: SELECT MAX(pd.id) AS max_id, pd.name AS player, MAX( pd.update_time ) AS last_seen, MIN( pd.login_time ) AS first_seen, SUM( pd.play_time ) AS ontime_total, SUM( CASE WHEN pd.login_time > NOW( ) - INTERVAL 1 DAY THEN pd.play_time END ) AS ontime_day, SUM( CASE WHEN pd.login_time > NOW( ) - INTERVAL 7 DAY THEN pd.play_time END ) AS ontime_week, SUM( CASE WHEN pd.login_time > NOW( ) - INTERVAL 1 MONTH THEN pd.play_time END ) AS ontime_month, (SELECT s.name FROM session_player sp INNER JOIN server s ON s.id=sp.server_id WHERE max(pd.id)=sp.id ) as last_server FROM ( SELECT sp.id AS id, sp.server_id as server_id, p.name AS name, sp.login_time AS login_time, sp.update_time AS update_time, sp.play_time AS play_time FROM session_player sp INNER JOIN players p ON p.id=sp.player_id WHERE p.name = ? ) as pd
c54258d5256400aa269ff7ef4691ab1a24acf24bedd6872cef3643c61c68d571
['edfc4ba0c6744172b3a2906186ed3b7a']
Yes, I was taking a look at the source code. I'm working on making a pull request, though there's not much documentation. I've realized now why I like C++. Python is great, but it is not easy to figure out how the objects of another person's project are constructed. It also seems that there is a big wishlist so I'd probably have to do this myself if I want it anytime soon.
c9ffd6eeda18f6ea23c9c4593b76e8d3ffae951f15f072fdb6ccec2f1b54e6dd
['edfc4ba0c6744172b3a2906186ed3b7a']
Interesting... So I made the change you suggested and I now get an error, "history position out of range". I also tried running it using it's full path (it made no difference). Also I am sure that the history position is not out of range.... I have more than 400 items in my history.
e0d4ed2b8df74dd4a7c7b1dae5b1060d64ebe3500093af1f3bba5470a38f7726
['ee09fcfcdcc14500bf1b0765bf5b3bc0']
In your situation you will want a branch office Exchange and Domain Controller (on separate boxes). You should setup two sites in AD. The sites will replicate AD to one another less frequently. The remote Exchange server will talk to its local DC and have all the AD information it needs sitting right there next to it. AFAICR, you will not need to setup any send/receive connectors between the Exchange servers. They should just know this mail should be delivered to this database and hand it over to the Exchange server that owns the DB. If they are in the same org as long as the proxy addresses are correct when a message hits Exchange it will figure out how to deliver the mail between the Exchange servers/DBs. One thing you may want to do on your send connector is to leave it scoped to your main Exchange server so that outgoing messages flow from Branch -> Main -> Edge. You will have to setup all Exchange roles in the branch office. Let me say that it has been a few years since I have worked on Exchange 2010 and so my recall on the finer details of mailflow might be off a bit, but I believe the above will work. Of course you will want to test everything to be sure. To me the biggest gotcha would be the namespace planning. Here's one document on namespace planning I could find. Unfortunately I know there is a better document out there that I cannot find right now. After a bit more searching I found it. CAS array names and relating to sites (among other things).
605c9a5a844cae7895dbaafdaba12fdf9f985b1b2776fcd5c0501bffcfc4bb16
['ee09fcfcdcc14500bf1b0765bf5b3bc0']
Could be lots of different things. What credentials are the scheduled task(s) running under? What commands are you running in your batch file? How are you connecting to the other machine to download the file? Just in general I would have your script write out a log file between each command so you can see at what point it is hanging at. Does it not even really start to process, or does it try to make the connection and fail, or does it not copy the file, or does it not copy the file to the place you think it would copy it to, or do you just need to have exit at the end?
62b9ed8377977d409f9086a11c5d3347e2fb83c8f05ec2873ce1106acafb9fc7
['ee0c37554f22446f96e488cce08205ca']
I'm working with a Leaflet map that displays marker data based on a MongoDB query. The query results are saved into a variable (I know, bad form for large volumes of info but okay if you only have ~25 pieces) as an array, and then I've iterated over that variable and it's stored information using a for loop to create my leaflet map markers and populate their popups with the information specific to each entry. This part works great. this.autorun(function(){ fsqresults = FsqResults.find().fetch({}); container = $('<div />'); for (i=0; i < fsqresults.length; i++) { marker = L.marker([fsqresults[i].geometry.coordinates[1], fsqresults[i].geometry.coordinates[0]], {icon: violetIcon}).addTo(mymap); container.html("<b>" + "Name: " + "</b>" + fsqresults[i].properties.name + "<br>" + "<b>" + "Address: " + "</b>" + fsqresults[i].properties.address + "<br>" + "<b>" + "Checkins: " + "</b>" + fsqresults[i].properties.checkIns + "<br>" + "<b>" + "Users: " + "</b>" + fsqresults[i].properties.usersCount + "<br>" + "<b>" + "Tips: " + "</b>" + fsqresults[i].properties.tips + "<br>"); marker.bindPopup(container[0]); } // end for loop For each marker, there is a button to log a "checkin" event to another Mongo collection to house the checkin entries. The button fires an event successfully, and creates the entry into the second database, but will not bind the dynamically populated data to the entry so I can see which marker the user has clicked on. container.append($('<button class="btn btn-sm btn-outline-primary js-checkin">').text("Check In")); container.on('click', '.js-checkin', function() { var currentVenue = fsqresults[i].properties.name; console.log(currentVenue); console.log("You clicked the button!"); if (!Meteor.user()) { alert("You need to login first!"); } if (Meteor.user()) { console.log("Meteor User Verified"); Checkins.insert({user: Meteor.user(), name: currentVenue}); } }); }); // end this.autorun The console tells me that currentVenue is undefined. I know this has something to do with the fact that fsqresults is a dynamically populated variable. I have tried to find ways to "solidify" the information in it (i.e. - creating a second variable with an empty array, pushing the data from fsqresults into it, and then having the markers iterate over that variable) but that hasn't worked as the MongoDB query results, despite being in an array format themselves, will not push or concat into the variable with an empty array successfully. I've been searching for an answer to this problem and I'm coming up short. I'm lost; is there any other solution which could be staring me in the face? Some things to note: All of this code lives in the Template.map.onRendered() function. Leaflet has scoping issues if I delegate the code into helpers and events, which is why I haven't created a {markers} template and just done {{#each markers}} over it for iteration. Therefore I am relegated to jQuery style coding for creating DOM elements and firing event triggers. The code above is wrapped in a this.autorun function to ensure it does indeed run upon map rendering. I don't think this is the issue (although one can never rule it out!).
84b23e41219e6b6397e796593979ed6d059056117343f6bb0a6154a65ac9ee48
['ee0c37554f22446f96e488cce08205ca']
I've come up with a solution to the first part of my issue - at first a javascript closure/scope issue to the inner and outer function scopes. I spent about 2 days wrapping my head around this SO answer: the concept of using the first for loop to produce individual instances of the function (if this were a play, the first for loop would "set the stage" for the show), and using the second for loop to execute each instance of the function ("lights, camera, action!"). I also decided that I could maintain scope if I declared my variables inside the first for loop - but I still had this issue of it only pulling the last value. Then I tried simply redeclaring my variables as constants. To my surprise, using const allowed me to write each instance to each map marker, and I could reliably access the correct iteration of the data upon each correspondent map marker! So no need for a second for loop. this.autorun(function(){ fsqresults_fetch = FsqResults.find().fetch({}); // console.log(fsqresults_fetch); for (i = 0; i < fsqresults_fetch.length; i++) { container = $('<div />'); const fsq_marker = L.marker([fsqresults_fetch[i].geometry.coordinates[1], fsqresults_fetch[i].geometry.coordinates[0]], {icon: blueIcon}).addTo(mymap); const fsq_venueAddress = fsqresults_fetch[i].properties.address; const fsq_venueName = fsqresults_fetch[i].properties.name; const fsq_geometry = {type: "Point", coordinates: [fsqresults_fetch[i].geometry.coordinates[0], fsqresults_fetch[i].geometry.coordinates[1]]}; container.html("<b>" + "Name: " + "</b>" + fsqresults_fetch[i].properties.name + "<br>" + "<b>" + "Address: " + "</b>" + fsqresults_fetch[i].properties.address + "<br>"); container.append($('<button class="btn btn-sm btn-outline-primary" id="js-checkin">').text("Check In")); fsq_marker.bindPopup(container[0]); container.on('click', '#js-checkin', function() { console.log("You clicked the button!"); if (!Meteor.user()) { alert("You need to login first!"); } if (Meteor.user()) { console.log("Meteor User Verified"); Checkins.insert({type: "Feature", geometry: fsq_geometry, properties: {name: fsq_venueName, address: fsq_venueAddress, user: Meteor.user()}}); } }); //end container.on } //end for loop }); //end this.autorun As I said in the comment on the last response, it's a bit hack-y, but functional enough to do the job successfully. Now what I'm really curious to try is the solution that @ghybs posted so I have my events grouped and firing as Blaze is supposed to work!
7a2b2b1c99ad6ac34196cb3f901cb3391f73e63ab241cb4369b5fd8d138887cc
['ee256bfc9e614807a1b8c80d934e02b8']
I am trying to run the pig script using the -f usecatalog option but it is giving me issue. it says script does not exist, while I can see the file is present in hdfs file system. see below. [hdfs@ip-xx-xx-xx-x-xx ec2-user]$ pig -useHCatalog -f /user/admin/pig/scripts/hcat1.pig WARNING: Use "yarn jar" to launch YARN applications. 16/04/01 13:44:13 INFO pig.ExecTypeProvider: Trying ExecType : LOCAL 16/04/01 13:44:13 INFO pig.ExecTypeProvider: Trying ExecType : MAPREDUCE 16/04/01 13:44:13 INFO pig.ExecTypeProvider: Picked MAPREDUCE as the ExecType 2016-04-01 13:44:13,645 [main] INFO org.apache.pig.Main - Apache Pig version <IP_ADDRESS><PHONE_NUMBER> (rexported) compiled Dec 16 20 15, 04:30:33 2016-04-01 13:44:13,645 [main] INFO org.apache.pig.Main - Logging error messages to: /tmp/hsperfdata_hdfs/pig_1459532653643.log 2016-04-01 13:44:14,184 [main] ERROR org.apache.pig.Main - ERROR 2997: Encountered IOException. File /user/admin/pig/scripts/hca t1.pig does not exist Details at logfile: /tmp/hsperfdata_hdfs/pig_1459532653643.log 2016-04-01 13:44:14,203 [main] INFO org.apache.pig.Main - Pig script completed in 753 milliseconds (753 ms) [hdfs@ip-xxx-xx-xx-xx ec2-user]$ hadoop fs -cat /user/admin/pig/scripts/hcat1.pig a = load 'trucks' using org.apache.hive.hcatalog.pig.HCatLoader(); b = filter a by truckid == 'A1'; store b INTO '/user/admin/pig/scritps/outputb1';
3a8b14804938a6b41c4d23110b61929cbb36eba01281e405cc1ffa73a62dfaee
['ee256bfc9e614807a1b8c80d934e02b8']
I am running a pig script , it is running fine but it fails when I am trying to store the output in file. dump works fine. Could someone please let me know the reason or at lease guide me to how to troubleshoot. pig -useHCatalog; a = load 'geolocation_part' using org.apache.hive.hcatalog.pig.HCatLoader(); b = filter a by truckid == 'A1'; Dump b; store b INTO '/user/admin/pig/scritps/geolocation_20160401';
41a4c2df35fc5015409b4ea2946a02483de2f9095002809b2305cbc5765cde79
['ee2634781f154cb9a0d83b8c6a8c366b']
You must set what's the decimal precision to be used, you can do it with stream manipulator setprecision (int n) where n will be the new precision to be used. You can look at the following example from http://www.cplusplus.com/reference/iomanip/setprecision/: // setprecision example #include <iostream> // std::cout, std::fixed #include <iomanip> // std<IP_ADDRESS><IP_ADDRESS>cout, std<IP_ADDRESS>fixed #include <iomanip> // std::setprecision int main () { double f =3.14159; std<IP_ADDRESS>cout << std<IP_ADDRESS>setprecision(5) << f << '\n'; std<IP_ADDRESS>cout << std<IP_ADDRESS>setprecision(9) << f << '\n'; std<IP_ADDRESS>cout << std<IP_ADDRESS>fixed; std<IP_ADDRESS>cout << std<IP_ADDRESS>setprecision(5) << f << '\n'; std<IP_ADDRESS>cout << std<IP_ADDRESS>setprecision(9) << f << '\n'; return 0; } Where the expected output should be: 3.1416 3.14159 3.14159 <PHONE_NUMBER>
e2c5bf2d0fe857b7da706a5d5b4fab12bf1aeb396406ad6b578a00e08a6ba404
['ee2634781f154cb9a0d83b8c6a8c366b']
I'm using python Logger in one of my programs. The program is a solver for an np-hard problem and therefore uses deep iterations that run several times. My question is if the Logger can be an issue in the performance of my program and if there are better ways to log information maintaining performance.
519ca8134d2adc042f8e1edc8418b53162830b4bb59c9339bfb2157a36c92dfd
['ee2d18c39ebf4aa4b71c4043999da563']
Note that there is a difference when using `sort -n | uniq` vs. `sort -n -u`. For example trailing and leading whitespaces will be seen as duplicates by `sort -n -u` but not by the former! `echo -e 'test \n test' | sort -n -u` returns `test`, but `echo -e 'test \n test' | sort -n | uniq` returns both lines.
59cd963be99a20b997f045d049834271219b53d8d48a07897717978c6e2913fb
['ee2d18c39ebf4aa4b71c4043999da563']
@user1742529 You want to use ratarmount on system without any Python installation on it? Python is quite ubiquitous, it doesn't hurt having it installed. I could look into something like building an AppImage, FlatPak, or Snap, would that suffice in your opinion? Not sure if they work for this use case though.
b62e6a867768a7152bb34feb5f19cb986cd32d3d6be1ab0cd79452f35c84e1aa
['ee2f9c65fada4506ac352da26ae3e2be']
I have a custom view that contain a framelayout. This framelayout contain two views (LinearLayout) that can be swipe. If I swipe the first one, the second one appears and vice versa. One of those views has a button but I don't know why, this button is like disable. I cannot click on it and the onClick method has no effect. Here the structure of the layout xml inflated in the custom view : <FrameLayout> <LinearLayout android:id="@+id/frontview" /> <LinearLayout android:id="@+id/backview"> <Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/ButtonUpdate" android:text="@string/bUpdate" android:padding="5dp" android:clickable="true" style="?android:attr/borderlessButtonStyle" /> </LinearLayout> </FrameLayout> Here the code in my custom view : public class mView extends LinearLayout { ImageView icon; TextView current_data; TextView previous_data; TextView time ; Button bUpdate; EditText TextUpdate; public mView(Context context) { super(context); init(context); } public mView(Context context, AttributeSet attrs) { super(context,attrs); init(context); } public mView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(context); } @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { // nothing } } public void init(Context pContext) { LayoutInflater inflater = (LayoutInflater) pContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View ll = inflater.inflate(R.layout.list_item_data, this, true); /** We initialize the elements of our UI **/ /** * First View */ icon= (ImageView) ll.findViewById(R.id.ic_icon); current_data = ll.(TextView) findViewById(R.id.current_data); previous_data = ll.(TextView) findViewById(R.id.previous_data); time = (TextView) ll.findViewById(R.id.time); /** * Second View */ bUpdate = (Button) ll.findViewById(R.id.ButtonUpdate); TextUpdate= (EditText) ll.findViewById(R.id.TextUpdate); bUpdate.setOnClickListener(new bUpdateClickListener()); } private class bUpdateClickListener implements OnClickListener { @Override public void onClick(View v) { // When the button is clicked, the front view re-appears and the backview disappears frontview .animate() .translationX(0); backview .animate() .translationX(-backview.getMeasuredWidth()); } } The swipe is correctly handle with onInterceptTouchEvent(MotionEvent ev) and onTouchEvent(MotionEvent ev). Here the main.xml used in MyActivity : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffffff"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#f6f6f6"> <TextView android:id="@+id/infoimc" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="18dp" android:layout_marginTop="8dp" android:text="@string/app_name" android:textColor="#000000" android:textSize="16dp"/> <View android:id="@+id/divider_infoimc" android:layout_width="match_parent" android:layout_height="1dip" android:layout_marginRight="18dp" android:layout_marginLeft="18dp" android:background="#99CC00"/> <com.example.essai.CustomGraph android:id="@+id/CustomGraph" android:layout_width="match_parent" android:layout_height="200dp" android:layout_gravity="center" android:visibility="visible" android:layout_marginTop="10dp"/> </LinearLayout> <FrameLayout android:layout_width="wrap_content" android:layout_height="80dp" android:layout_gravity="left|center_vertical"> <com.example.essai.mView android:id="@+id/CustomView" android:layout_width="match_parent" android:layout_height="wrap_content"/> </FrameLayout> </LinearLayout> And MyActivity.class : public class MyActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } I don't know if the button must be handle also in the Activity ? Thanks for your help !
241b06998d6c8953f72e0f834d24d851365d8c29c4b406b8c47fe8f9a88eb058
['ee2f9c65fada4506ac352da26ae3e2be']
I know that this question has been asked several times but I really don't understand why my code doesn't work. I based upon a lot of examples (from stackoverflow answers) to write my code and I need help to understand where is the problem. The context The user can, trough preferences, choose a day to be notify. I get a number from 2 (monday) 3...4...5... to 1 (sunday). public Calendar getCalendar(){ Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_WEEK,getDayForNotification()); calendar.set(Calendar.HOUR_OF_DAY, 8); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.AM_PM,Calendar.AM); return calendar; } Then I want to repeat the alarm once a week on the day that the user has chosen. public void setNotificationDate() { alarmMgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(this, myAlarmReceiver.class); alarmIntent = PendingIntent.getBroadcast(this, 0, intent, 0); DateNotificationPreference dateNotificationPreference = new DateNotificationPreference(this); alarmMgr.setRepeating(AlarmManager.RTC, dateNotificationPreference.getCalendar().getTimeInMillis(),AlarmManager.INTERVAL_DAY * 7, alarmIntent); } My broadcast receiver public class myAlarmReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent service1 = new Intent(context, AlarmService.class); context.startService(service1); } } In my service, I have juste one method : public void createNotification(){ final NotificationManager mNotification = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); final Intent launchNotifiactionIntent = new Intent(this, mySilhouette.class); final PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, launchNotifiactionIntent, PendingIntent.FLAG_UPDATE_CURRENT); Notification.Builder builder = new Notification.Builder(this) .setWhen(System.currentTimeMillis()) .setSmallIcon(R.drawable.icon_notification) .setContentTitle("my notification") .setContentText("my first notification") .setContentIntent(pendingIntent); mNotification.notify(0, builder.build()); } When I choose the current day, the notification appears at the good time, but when I relaunch the app at 8:05 am for example, I have again a notification. After that, if I choose another day and go back to the activity, I have again a notification...There is something strange and I don't know what can be the problem. I need your help :) Thanks a lot ! <PERSON>
5eb3ecefe81624a725762f825b120076b79a85538d53ec42b1bc9b10f9387039
['ee307ee41ec74a27b721a05ca73c7ab5']
I want to have the user input a start and end of a list and for the program to find all the prime numbers in it and to print them. Right now my code looks like this: def rangeStartEndPrime(v1, v2): import math check_prime = (v1,v2+1) for num in check_prime: is_prime = True for i in range(2, int(num**0.5) + 1): if (num % i) == 0: is_prime = False return int(is_prime == True) number1 = int(input("Please enter start value: ")) number2 = int(input("Please enter end value: ")) range = rangeStartEndPrime(number1, number2) print(range) Output: Please enter start value: 4 Please enter end value: 100 1
c5b302b2f16fd15058e9c2517f0c05998afa2fe6be7c93ea348dd78d99c8ffca
['ee307ee41ec74a27b721a05ca73c7ab5']
I have written a code where the user enters a code and the program rotates it by the desired amount but each time it rotates by two and not one. E.g. 1 2 3 4 5 rotated by one would turn into 4 5 1 2 3 My code is: arSize = int(input("Please enter the size of the list ")) arr = [] d = int(input("How many times do you want to rotate it to the right? :")) for i in range(0, arSize) : number = int(input("Please enter array[" + str(i) + "] value: ")) arr.append(number) n = arSize def rightRotate(arr, d, n): for i in range(d): rightRotatebyTwo(arr, n) def rightRotatebyTwo(arr, n): temp = arr[0] temp1 = arr[1] arr[1] = arr[n-1] arr[0] = arr[n-2] for i in range(2, n-1): temp2 = arr[i] temp3 = arr[i+1] arr[i] = temp arr[i+1] = temp1 temp = temp1 temp1 = temp2 def printArray(arr, size): for i in range(size): print (arr[i]) rightRotate(arr, d, n) printArray(arr, n) This is the outcome: Please enter the size of the list 6 How many times do you want to rotate it to the right? :1 Please enter array[0] value: 1 Please enter array[1] value: 2 Please enter array[2] value: 3 Please enter array[3] value: 4 Please enter array[4] value: 5 Please enter array[5] value: 6 5 6 1 2 3 2
743f9bbd7b99fdc354eee9a3c77525bfa40a712f68c28d3bef7b05ca957ce839
['ee40605483b94b609bd11436b4dd4a10']
про ссылку: благодарю, ознакомился, но нет, все верно, качество не падает, потому что в сохраненном mp3 файле все ок, как и должно звучать второе: на входе у нас непрерывный поток, который извлекается с любого записывающего цифрового устройства (микрофон, аналоговый вход, ретрансляция потока для динамиков и т.д. и т.п.). Вы правы в том, что я тоже подозреваю, что где-то среди кадров уже MP3 имеется его заголовок согласно документации MP3 из вики и смежных источников. Только вот тогда я не знаю как мне их отфильтровать и по какому признаку.
d80e355af478162e11ecb8109422262f19dacbf281b50f249b472f61fa72675e
['ee40605483b94b609bd11436b4dd4a10']
@MSDN.WhiteKnight вот здесь может быть проблема конвертации? как я понял, у mp3 другая частота дискретизации и кол-во кадров тоже отличается, а указал его значение я здесь. при установке 128 кадров для wav канала, он выводит ошибку, что максимум - 16, кое сейчас вообще должно и быть по умолчанию. Я не совсем понимаю принцип, может ли в этом быть дело. using(var rdr = new RawSourceWaveStream(ms, new WaveFormat(44100, 2))) using(var wtr = new LameMP3FileWriter(retMs, rdr.WaveFormat, 128)) Еще не могу понять на каком этапе происходит сбой: при трансляции в сеть или при преобразовании
235c2b29438188316dcde4732465a863912d295a80be7afca2ce4af61d1c0b0a
['ee57f38603e24c249cab7c2099e4660d']
I really feel for you. I had a very similar experience in math graduate school. I won't go in to the details, but let's say I ended up in a research group whose general area I was interested in, but the particular research they did was not as interesting to me and required a rather different background. I struggled to fill in the gaps in my background, but it was difficult not least because I wasn't all that interested in it, and I always felt only half welcome in the group. I ended up basically taking approach 2 from your list, working on a project at the interface between my current group and another group in the department. I wouldn't say the latter group "required less foundational material", but the stuff I wanted to work on had not been that heavily studied before, so it was in some sense easier because I was the first to look at it seriously. Not surprisingly, the results were not particularly breakthrough, however, but I did complete my PhD defense ( a year longer than usual ). I have since left academics, in no small part due to my experiences in the social and societal aspects of academic math life. In fact, realizing this about the fourth year of my PhD program, I started looking outside of academia for job opportunities, took a couple of classes in more applied fields, and contacted a recruiter. If you decide to go this route, I very strongly recommend contacting someone to help you with the job search. In my experience, the disdain for leaving academics and entering industry amongst pure mathematicians, while mostly tongue-in-cheek, nevertheless means they are clueless about the prospects and the process. Again, one person's experience, but I think it can't hurt to reach out. I might have been able to struggle harder through the foundational material, but I felt I would have ended up with a thesis in a subject that was not my passion, and it seemed to me at the time at least that once you've gone that far into a specific research field, your post-doctoral position(s) will be in that field, and it will be even harder to switch; I didn't want to spend my career in the same field as my research group. I don't mean to dissuade you from trying to stay in academics, but I will say that I'm very happy with where I've ended up. I would also caution you, the last year of my graduate school was very difficult and I had to find my own way both in terms of research and job prospects; my advisor could not have cared less about my job search once I was no longer looking in academics.
462f0fed1c0617688e0594e1f9d1ad3f65a23918739fc36186a3ae855b5a4001
['ee57f38603e24c249cab7c2099e4660d']
I have pretty significant anecdotal insight here. I went to a very good but not quite top tier ( in math ) school and jointly majored in a humanities degree and a math degree. I was active in the math department, but was not the top student. I took maybe one or two graduate courses as an undergrad. By my senior year I decided to focus more on math, but didn't think I would get in to a top tier graduate program ( and, for me, it wasn't worth it not to go to a top tier program. Please keep in mind that this is not true for everyone and was a personal choice ). I was confident, and received confirming feedback from professors, that I probably would not be able to achieve this goal with my background. In my senior year I applied to several scholarships for graduating undergraduates, like Fulbright and Marshall scholarships, but did not succeed. I then applied to and was accepted into BSM. It's an excellent program, and I would say that it's an even better opportunity to learn a lot. When I was there, academics was not 100% the goal for around half of the other students; for many of them it's the "study abroad" experience. I do not mean to disparage them at all; this experience can be very important for personal growth and perhaps even more important than the academic experience. I simply mean to point out that you're working with absolutely top tier educators and mathematicians who care very much about the program and if you're there for the academics then you have an opportunity work closely with them and have a lot of access. I focused extremely hard both during the summer before BSM, and during my time in Budapest, working on a ( small ) independent research project and rounding out my background, while making sure that I excelled while in Budapest. I can echo the other answer that the courses were quite difficult, probably closer to a graduate level than undergraduate ( although I probably took more advanced courses ). Anyway, punchline of the story is that I got in to the top school of my choosing for graduate school. I had recommendation letters from BSM professors and from professors from my undergraduate institution. I don't know how they evaluated, but I believe that my strong grades from undergrad ( at a near top but not top school ), my activity in undergrad activities within the math department, and my performance and dedication ( eg. research ) in BSM were the major contributing factors. Regarding the school I attended for graduate school, most students were high school olympiad medalists ( I didn't know what the olympiad was until college ) and/or putnam finalists ( I participated 3 years, never getting honorable mention, but scoring okay ). I definitely felt like I was the "least" among them, but learned later many of them felt the same about themselves ( see "imposter syndrome"). There were a couple of top tier graduate programs that rejected me, so I'd say that the experience put me in the mix. So, moral of the story for me is that it can absolutely help you. It requires, however, a lot of effort and at least a pretty good background on top of that. I would also like to emphasize that I know many people that had amazing experiences and learned a ton at next tier and next next tier graduate programs, some of whom have successful academic careers. The best of the best students in my graduate program got something out of being with those stratosphere level professors that, to be honest, I was not capable of. My guess, although every story is different, is that you may have an even better experience at a next tier graduate school rather than top tier.
ed4e4f132fde220167feffef53c984d9ec1f9b1a5ff69ae67f2eed06ebf87aff
['ee62a927478441399192c62859b04186']
You have to look to official ReactiveX documentation: https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md. This is a good article about piping in RxJS: https://blog.hackages.io/rxjs-5-5-piping-all-the-things-9d469d1b3f44. In short .pipe() allows chaining multiple pipeable operators. Starting in version 5.5 RxJS has shipped "pipeable operators" and renamed some operators: do -> tap catch -> catchError switch -> switchAll finally -> finalize
28fb451b2c803e1e56b3aaf48120cc3af478a985e0f0ac20e67b2696e33e3d56
['ee62a927478441399192c62859b04186']
You can try this example (without Typescript for simplicity): source file: import { of } from 'rxjs'; const tempVolunteers = [ { firstName: '<PERSON>', lastName: '<PERSON>', totalHoursLogged: 85 }, ]; export const getAllVolunteers = of(tempVolunteers); React app file: import React, { Component } from 'react'; import { getAllVolunteers, } from '../RxJS'; class App extends Component { state = { list: [], }; componentDidMount() { getAllVolunteers.subscribe((item) => { this.setState({ list: [...this.state.list, ...item], }); }); } render() { return ( <div> <ul> { this.state.list .map(({ firstName, lastName, totalHoursLogged }) => ( <div key={lastName}> {`${firstName} ${lastName} - ${totalHoursLogged}`} </div> ), ) } </ul> </div> ); } } export default App;
680273c208b70c0232104ed60983548b78a51804feef83f9da933c99d62aa0ed
['ee6da477f5ba4989a121fdc29a175976']
Maybe stupid question but I am developing for android 2.2 to 4.1. Can I use this functionality http://developer.android.com/reference/android/preference/PreferenceFragment.html which is available only from API 11? or must I use old http://developer.android.com/reference/android/preference/PreferenceActivity.html which has some deprecated methods. Will old API works well on android 4.1?
223ab2e7ccb3775f2335de76a08a7661a59d857bd59e49540a0da5af8c4794a3
['ee6da477f5ba4989a121fdc29a175976']
private class CompAdvertisements : IComparer<Advertisements> { private string OrderBy { get; set; } public CompAdvertisements(string orderBy) { OrderBy = orderBy; } #region IComparer<Advertisements> Members public int Compare(Advertisements x, Advertisements y) { return x.Country.Name.CompareTo(y.Country.Name); Can i also user x.Name.CompareTo(y.Name); in comparer that i will compare with two elements lik order by something and order by something2
6097386b85941ddc92c2deff1ee53793530a79f05a3c35425c41ba45e3fc7d53
['ee6e0955820544c0ac3f1948d48f8b2b']
I've tried to mask image with my png and it perfectly works on chrome. However, it doens't work on Firefox. Here is the style I used -webkit-mask: url("../img/mask.png"); -o-mask: url("../img/mask.png"); -ms-mask: url("../img/mask.png"); Does Firefox support masking and how to do it?
77a56dad9435d08e7863c8513dfefcd9cd3fbb6f884f3b6cbc0a72a4fa38df2c
['ee6e0955820544c0ac3f1948d48f8b2b']
http://iscrolljs.com/ I'm trying to search but I cannot find anything about adding inertia to iScroll js when we are scrolling it with mouse wheel (not when dragging it). When I use mouse wheel, I'd like it to have momentum or inertia too. Is it possible to do it?
7e8deb1cf2dc7badac81915c2673d2e00b8f6ea723fc9a65fe7ef54418ab74fe
['ee71dbab8188423693b504c980127498']
Currently I am working on an ASP.NET MVC application that should use an existing framework. I am hosting this ASP.NET MVC app in IIS Express. Some classes of this framework assume that files are relative to the current directory. Right now the assemblies are executed in c:\users\MyName\appdata\local\temp\temporary asp.net files\root\3c076611\5261f232\assembly\dl3\d36edef7\e39ad394_8136d101. Is it possible to change this directory?
8122f0139c5a2f8f1c6bba17a0a1bb664d6642a4545cfeba8afa665efd21ce7f
['ee71dbab8188423693b504c980127498']
I finally placed a checkbox in the InstallDirDlg and based on its value I decided whether to use a Component with a ServiceInstall element with Start='auto' or to use a Component with a ServiceInstall element with Start='demand'. This solved my first problem. But I couldn't use the ServiceControl Element to start the service because this would start the service directly after the installation and my service needs to be configured before it can work properly. So I finally ended up to start my Service from my source code. That way I was able to use a CustomAction that was fired on the ExitDialog 'Finish'-Control.
48e62437ef61b70b26684f67a882a3940c90fbd4c390c80dd60f0d86b49ddb04
['ee73b19ee1df4743994775c97546ea03']
I have a question regarding quering site groups via REST Graph API instead of SharePoint REST API. Currently I need to query SharePoint REST API to find implicit groups (*Visitors, *Members, *Owners) for each site in order to find users that are members of those groups (those groups are not present in groups Graph API). To achieve this I am using two queries. First: https://{site_url}/sites/{ site name}/_api/Web/SiteGroups to obtain list of implicit groups with type ids, and then: https://{site_url}/sites/{ site name}/_api/Web/SiteGroups/GetById({id})/Users to obtain list of users in one specific group obtained from first query. So the question is: Are any equivalents to those two queries above in REST Graph API or I need still to obtain those information from SharePoint REST API?
b246507dfb2d42040814d6be423482c6d5fc35cf4c0f74399deef777e8b80063
['ee73b19ee1df4743994775c97546ea03']
If I believe my money variable (price of an item) does not have a linear relationship with interpreted user value/worth, should I transform it so that its split in the decision tree is based on a modified relationship between price:worth rather than tre linear one that I feel is incorrectly assumed?
029da032ae238725e5556ad715399d1cd8ab3927c1104e1a69aecc3c6ef25651
['ee74faba26c840318e13fe535a1b3c35']
I am using BinarySecurityToken for OTA_AirRulesRQ, but I am getting USG_AUTHORIZATION_FAILED. I used the same token for BargainFinderMaxRQ and it worked. Is it some problem with the SOAP request I am sending or access to this method is not authorized form my PCC ? Also I am able to hold PNR and Issue ticket with same credentials Please Suggest
821d2d6e8fe3076a1472aa78e01a1541b03820a0a866a1b39766bc601cf98da6
['ee74faba26c840318e13fe535a1b3c35']
PLEASE MAKE THREE CHANGES AND IT WILL WORK PERFECTLY 1) SET ACTION NAME AS BargainFinderMax_ADRQ <eb:Service eb:type="OTA">BargainFinderMax_ADRQ</eb:Service> <eb:Action>BargainFinderMax_ADRQ</eb:Action> 2) SET NUMBER OF DAYS FOR FLEXIBILITY <DateFlexibility NbrOfDays="1"/> OR <DateFlexibility NbrOfDays="3"/> OR <DateFlexibility NbrOfDays="7"/> 3) SET REQUEST TYPE NAME <RequestType Name="AD1"/> OR <RequestType Name="AD3"/> OR <RequestType Name="AD7"/>
59e5d4d7ac5eb23a77ba0e7329e3dd30a96f03e3df31588b78b305021ec7eec3
['ee816fc0c8a74e60aa87c6f133b75f45']
I have set up a sonarqube instance via docker and I am using Caddyserver as a reverse proxy. Unfortunately I am unable to execute the sonar scanner. I get following error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target There are quite a lot of similar questions out there and most of them say, that you have to import the servers certificate to the client. I am not sure why I would need to do that for a trusted certificate. I can connect to my sonarqube instance via chrome and the connection is marked as secure and the certificate as valid. How is it possible that Chrome says my connection is valid but java doesn't?
02e146362b17dc4ff9bb50ee0c146a07122e4f03bdf817b4866e6aca4d5a500d
['ee816fc0c8a74e60aa87c6f133b75f45']
I solved my problem. It was actually an issue with my firewall. The firewall was dropping packets sent via PHP, but via curl or wget were not being dropped. I added a rule for all traffic from that server and increased the packet drop length and everything is working great now! This page was what pointed me in the right direction: http://www.radiotope.com/content/safari-and-sonicwall
7c812ce7fbcd62ae0c79850e4f46c64057bf03d73b9fa5166b0d4e9a130e0842
['ee83fd549abf4dd5a5fb1d310d08c3ae']
I have a private pod, its role is to manage some "IconFont", it contains a .ttf file. I hope my other projects will automatically register this font in the info.plist file when they rely on this pod I wrote a script: s.prepare_command = <<-CMD cd .. project_path=$(cd `dirname $0` ; pwd) project_Name=${project_path##*/} if [[ -f "Other/Info.plist" ]]; then infoPlist=$project_path"/"$project_Name"/Other/Info.plist" else infoPlist=$project_path"/"$project_Name"/"$project_Name"/Other/Info.plist" fi /usr/libexec/PlistBuddy -c 'Add :UIAppFonts array' $infoPlist /usr/libexec/PlistBuddy -c 'Add :UIAppFonts: string iconfont.ttf' $infoPlist CMD As far as I know, the prepare_command command will be carried out in the Pods directory (may not be this directory?). When I encapsulate the above code as register.sh and execute sh register.sh in the Pods directory, this code works —— Added UIAppFonts field in info.plist of host project. Maybe prepare_command does not meet my needs? How can I solve this problem? thank!
ba672a2c6c4afe17125959dbf499ae8ff9272e7810c0c41dfe22ec9366a96b05
['ee83fd549abf4dd5a5fb1d310d08c3ae']
I wrote the following code and set a custom back button icon: let navigationBar = UINavigationBar.appearance() navigationBar.backIndicatorImage = image navigationBar.backIndicatorTransitionMaskImage = image It works, which is good. But now in another controller, I want to reuse the system’s back button icon. I have tried the following in the new controller: Set backIndicatorImage and backIndicatorTransitionMaskImage to nil. navigationItem.backBarButtonItem = nil But this doesn't work. My application needs to support iOS 10, so I cannot use SF Symbol. What should I do?
4b926cecd0cdf2967694ab71a88e176f33deeef4ed086040e11bf6e1e929bbb2
['ee968efd472c40f592d1b123c51c173d']
I'm trying to implement multi-language in my app (English & Hebrew). I've created 2 string files and implemented all the methods that should support the multi-language feature. However, when I run the app and select "Hebrew" in the dialog, the layout changes from left-to-right to right-to-left (as it should be in Hebrew), but the language isn't changing. Could anyone help me figure this out? import android.app.Activity; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.os.Vibrator; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import java.util.Locale; public class MainActivity extends AppCompatActivity { private Button btn_chooseBoard; private Button btn_store; private Button btn_language; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); loadLocale(); setContentView(R.layout.lay_main); Constants instance = Constants.getInstance(); instance.getAllPlayers(); instance.getAllBoards(); btn_chooseBoard = (Button) findViewById(R.id.btn_startGame); btn_store = (Button) findViewById(R.id.btn_popup_store); btn_language = (Button) findViewById(R.id.btn_language); btn_chooseBoard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(MainActivity.this, ChooseBoard.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); ((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).vibrate(20); } }); btn_store.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(MainActivity.this, Store.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); ((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).vibrate(20); } }); btn_language.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { showChangeLanguageDialog(); } }); } /** * Reset game on resume main activity */ @Override public void onResume() { super.onResume(); GameLogic.getGameLogic().resetGame(); } private void showChangeLanguageDialog() { // Array of language to display in alert dialog final String[] listItems = {"English", "עברית"}; AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle("Choose Language..."); builder.setSingleChoiceItems(listItems, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { if (i == 0) { // English setLocale("en"); recreate(); } else if (i == 1) { // Hebrew setLocale("iw"); recreate(); } // Dismiss alert dialog when language stored dialogInterface.dismiss(); } }); AlertDialog alertDialog = builder.create(); // Show alert dialog alertDialog.show(); } private void setLocale(String lang) { Locale locale = new Locale(lang); Locale.setDefault(locale); Configuration configuration = new Configuration(); configuration.locale = locale; getBaseContext().getResources().updateConfiguration(configuration, getBaseContext().getResources().getDisplayMetrics()); // Save data to shared preference SharedPreferences.Editor editor = getSharedPreferences("Settings", MODE_PRIVATE).edit(); editor.putString("language", lang); editor.apply(); } // Load language saved in shared preference public void loadLocale() { SharedPreferences pref = getSharedPreferences("Settings", Activity.MODE_PRIVATE); String language = pref.getString("language", ""); setLocale(language); } }
664f239ab8f666d5aadf9fbdca7b502a68e0567c7ed48c7b43887719c94520e9
['ee968efd472c40f592d1b123c51c173d']
I have a circle image that contains multiple image-background 's - an image and a gradient. I would like to blur only the image and keep the edges of the circle sharp. I use this image a few times in my HTML code and would like to use different levels of blur in each image - Like the example below. I tried multiple solutions online, but neither of the solutions I found fits to circle edges. Link to Codepen img { width: 1.2em; height: 1.2em; padding: 0.3em; border-radius: 50%; border: 1px solid #000000; background-image: radial-gradient(#aac0e8, #b9cde5, #dce6f2); margin: 0%; } . <div id="natoTarget" class="infoContainer"> <div class="infoTitle"> <img id="imgNatoTarget" src="img\nato.svg" alt="Nato Target"> <label id="labelNatoTarget">NatoTarget</label> <label id="labelNatoTargetSize">(2.3 x 2.3)</label> </div> <div class="parameterContainer"> <div id="natoDetection" class="parameterLine"> <img id="iconNatoDetection" class="svgBlur" src="img\nato.svg" alt="Nato Detection"> <label id="labelNatoDetection" for="inputDetection">Detection: </label> <output id="inputNatoDetection" name="outputParameter">33</output> </div> </div> <div class="parameterContainer"> <div id="natoRecognition" class="parameterLine"> <img id="iconNatoRecognition" src="img\nato.svg" alt="Nato Recognition"> <label id="labelNatoRecognition" for="inputRecognition">Recognition: </label> <output id="inputNatoRecognition">33</output> </div> </div> <div class="parameterContainer"> <div id="natoIdentification" class="parameterLine"> <img id="iconNatoIdentification" src="img\nato.svg" alt="Nato Identification"> <label id="labeNatolIdentification" for="inputNatoIdentification">Identification: </label> <output id="inputNatoIdentification">33</output> </div> </div> </div> Example: .
ae93ea3862ed841c821ec537fa6cffe36be6426255040f4b2bb6dba2fd22129a
['eea539688aef4bc79ef250df2e8212cd']
I am trying to do a two-slider animation using Blender Rigid Body physics. I want each slider to go on opposite direction at any time. I tried using Force fields but to no avail. Almost every video on youtube about Blender Physics is about Demolition. This model is for the ailevon (aileron+elevator) mechanism for a jet aircraft I am designing. Currently, with the current settings, the ailevon (the Green cube on your left), is only going up, that is, in one direction. I want it to swing up AND down. I first tried using only one slider. But it didn't work. So, I thought using two sliders would. That too is not working. Am I missing anything. Any idea is welcomed!
2889492a3fa730f9d17e6987bf90e87b5a9933d63fe0893165c68dbf46d99891
['eea539688aef4bc79ef250df2e8212cd']
The problem is not in NC unless P=NC. <PERSON> and <PERSON> showed in "Complete Problems for Deterministic Polynomial Time" that the problem (therein called CFMEMBER) is P-complete. Interestingly, <PERSON> and <PERSON> showed in "Parallel Complexity of of logical query programs" that the same problem where the input CFG has no epsilon productions is in NC (Corollary 7.2).
da3529aa554740d1b9df53a41ebd2cdd7001641a73e1007119c984060fc08ea0
['eea99807f1b24da8b174cfaa3216e089']
I guess something like this: #include <iostream> #include <map> #include <vector> int main() { std<IP_ADDRESS>map<int,int> dummy; dummy.insert(std<IP_ADDRESS>pair<int,int>(1, 40)); dummy.insert(std<IP_ADDRESS>pair<int,int>(2, 30)); dummy.insert(std<IP_ADDRESS>pair<int,int>(3, 60)); dummy.insert(std<IP_ADDRESS>pair<int,int>(4, 20)); dummy.insert(std<IP_ADDRESS>pair<int,int>(5, 50)); std<IP_ADDRESS>vector<int>v{1,3,5}; std<IP_ADDRESS>map<int,int> final; // Final map for(auto&e:v) final[e]=dummy[e]; // Set key from vector, get value from dummy. for(auto it = final.cbegin(); it != final.cend(); ++it) { std<IP_ADDRESS>cout << it->first << " " << it->second << "\n"; } }
aa1caf18c077203835b758a63b3a41bdf958bd6893387a2f53de11ee00ef6c38
['eea99807f1b24da8b174cfaa3216e089']
I am sorry to carry this here, but I spend around 7 hours maybe for a really easy thing. Maybe some of you identify the problem. I try to render some pixel coordinates to screen. The code is below. For a 800x600 screen. Simply trying to calculate the position of the lines, and then to render it to the screen. For example: Point A(400, 300, 0) and point B(500,300,0) shall be a simple black line from the center of the screen to the right. As I call this class function in render, I thought I might be creating a separate rendering session. However, when I write something such as glCleanColor, the background changes. #include <GLFW/glfw3.h> #include <GL/gl.h> #include <GL/glew.h> #include <iostream> #include <vector> Vertex shader: const GLchar *vertex_shader = "#version 410\n" "layout (location = 0) in vec3 pos;\n" "layout (location = 1) in vec4 col;\n" "uniform mat4 projection;\n" "out vec4 Frag_Color;\n" "void main()\n" "{\n" " Frag_Color = col;\n" " gl_Position =projection*vec4(pos.xyz,1);\n" "}\n"; Fragment Shader: const GLchar *fragment_shader = "#version 410\n" "in vec4 Frag_Color;\n" "layout (location = 0) out vec4 Out_Color;\n" "void main()\n" "{\n" " Out_Color = Frag_Color;\n" "}\n"; Vertex structure struct Vrtx { float pos[3]; float col[4] = {0.0f, 0.0f, 0.0f, 1.0f}; }; coord axis class: class CoordinateAxis { public: void coordinate_axis() { vertices.resize(6); for (int i = 0; i < 3; i++) { vertices[2 * i].pos[0] = 400; vertices[2 * i].pos[1] = 300; vertices[2 * i].pos[2] = 0; } vertices[1].pos[0] = 500; vertices[1].pos[1] = 300; vertices[1].pos[2] = 0; vertices[3].pos[0] = 400; vertices[3].pos[1] = 400; vertices[3].pos[2] = 0; vertices[3].pos[0] = 400; vertices[3].pos[1] = 430; vertices[3].pos[2] = 100; setupRender(); glBindVertexArray(VAO); glDrawElements(GL_LINE, 6, GL_UNSIGNED_INT, 0); glBindVertexArray(0); glUseProgram(0); } CoordinateAxis() { initShaderProgram(); }; private: void initShaderProgram() { // Vertex shader GLuint vHandle = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vHandle, 1, &vertex_shader, NULL); glCompileShader(vHandle); // Fragment shader GLuint fHandle = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fHandle, 1, &fragment_shader, NULL); glCompileShader(fHandle); // Create Program handleProgram = glCreateProgram(); glAttachShader(handleProgram, vHandle); glAttachShader(handleProgram, fHandle); glLinkProgram(handleProgram); attribLocationProj = glGetUniformLocation(handleProgram, "projection"); glGenVertexArrays(1, &VAO); // CreateBuffers glGenBuffers(1, &vboHandle); glGenBuffers(1, &iboHandle); } void setupRender() { GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport); float L = last_viewport[0]; float R = L + last_viewport[2]; float B = last_viewport[1]; float T = B + last_viewport[3]; const float ortho_projection[4][4] = { {2.0f / (R - L), 0.0f, 0.0f, 0.0f}, {0.0f, 2.0f / (T - B), 0.0f, 0.0f}, {0.0f, 0.0f, -1.0f, 0.0f}, {(R + L) / (L - R), (T + B) / (B - T), 0.0f, 1.0f}, }; glUseProgram(handleProgram); glUniformMatrix4fv(attribLocationProj, 1, GL_FALSE, &ortho_projection[0][0]); glBindVertexArray(VAO); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, iboHandle); glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(GLuint), indices.data(), GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, vboHandle); glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(Vrtx), vertices.data(), GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, vboHandle); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, vertices.size() * sizeof(Vrtx), 0); glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, vertices.size() * sizeof(Vrtx), (void *)(3 * sizeof(float))); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); } std<IP_ADDRESS>vector<Vrtx> vertices; std<IP_ADDRESS>vector<GLuint> indices; GLuint handleProgram, VAO, vboHandle, iboHandle, attribLocationProj; };
a55b7cd55d54bc779b69db8440cb76b51531df8b71773b496b94777bb50ffdd5
['eeac029d99244e2084da600f4d4ea36e']
Thanks for the comments. All but the XY arrogance were helpful. The comment about ildasm being the most helpful. I had forgotten about this but it's fantastic. Nearly gave me an ildasm. MethodBuilder incPropMthdBldr = tb.DefineMethod("_Inc" + propertyName, MethodAttributes.Public , null, new[] { propertyType }); incPropMthdBldr.DefineParameter(0, ParameterAttributes.In, "increaseBy"); ILGenerator incIl = incPropMthdBldr.GetILGenerator(); incIl.Emit(OpCodes.Nop); incIl.Emit(OpCodes.Ldarg_0); incIl.Emit(OpCodes.Ldarg_0); incIl.Emit(OpCodes.Ldfld, fieldBuilder); incIl.Emit(OpCodes.Ldarg_1); incIl.Emit(OpCodes.Add); incIl.Emit(OpCodes.Stfld, fieldBuilder); incIl.Emit(OpCodes.Ret); The best results invoking were done by following this guide https://www.codeproject.com/Articles/10951/WebControls/ One of the comments is copy/paste gold. I am caching the delegates private Dictionary<Int32, DynamicMethodDelegate> valueDeltas; then as my transform block hits the checkered flag foreach (var kvp in result) { valueDeltas[kvp.Key](rowData, kvp.Value[0]); sampleDeltas[kvp.Key](rowData, kvp.Value[1]); //... the overall my approach is still nowhere near 100% efficient it is massively improved over datatables
d41b171701c3f0cd5f15be0d476ba14190938b2288dbfa4c36006bdfc21c80ee
['eeac029d99244e2084da600f4d4ea36e']
I am creating a dynamic type at runtime with the purpose of creating/serializing/deserializing objects from this type to then bind to a grid control. Everything works but my way of updating properties with records from the database is pathetic. I pasted this setter generator from somewhere and it works wonderfully when called via either delegate or PropertyInfo(...).SetValue(...) ILGenerator setIl = setPropMthdBldr.GetILGenerator(); Label modifyProperty = setIl.DefineLabel(); Label exitSet = setIl.DefineLabel(); setIl.MarkLabel(modifyProperty); setIl.Emit(OpCodes.Ldarg_0); setIl.Emit(OpCodes.Ldarg_1); setIl.Emit(OpCodes.Stfld, fieldBuilder); setIl.Emit(OpCodes.Nop); setIl.MarkLabel(exitSet); setIl.Emit(OpCodes.Ret); propertyBuilder.SetSetMethod(setPropMthdBldr); But when I try to get cheeky and make my own version that increments rather than setting ILGenerator incIl = incMethodBuilder.GetILGenerator(); incIl.Emit(OpCodes.Ldarg_0); //add object to stack incIl.Emit(OpCodes.Ldfld, fieldBuilder); //add current field value to stack incIl.Emit(OpCodes.Ldarg_1); //add method parameter to stack incIl.Emit(OpCodes.Add); //combine last 2 items incIl.Emit(OpCodes.Stfld, fieldBuilder); //write added value back incIl.Emit(OpCodes.Nop); //no clue incIl.Emit(OpCodes.Ret); When I try to invoke this bad boy either via a delegate or even GetMethod(...).Invoke(...) I get the same fail Common Language Runtime detected an invalid program. Pretty obvious my il is wrong but I am not seeing the exact issue. I wouldn't even mind modifying the setter as the only thing that's ever done to these properties is that they're incremented Also thanks in advance to anyone who comments that my design is bad
94e19275f854a14f9008a66184897e94315ec6cdfa94e3f890d492d3bf10b755
['eeadceef35bb46f7b4c2aee69b7e767c']
let toDoList = []; window.onload = function () { let ulElement; let node; let textnode; let form = document.getElementById("taskForm"); form.addEventListener("submit", addTask); } function insertTasksInHtml(newTask) { ulElement = document.getElementById("list"); node = document.createElement("li"); textnode = document.createTextNode(newTask); node.appendChild(textnode); ulElement.appendChild(node); } function addTask(e) { e.preventDefault(); let taskInput = document.getElementById("taskInput").value; if (taskInput === "") { alert("Please insert a task before you submit"); } else { toDoList.push(taskInput); insertTasksInHtml(taskInput); } } <html> <body> <div id="createNewTaskContainer"> <form id="taskForm"> <input id="taskInput" type="text" /> <button type="submit" id="createTaskButton">Add</button> </form> </div> <div id="listOfTasksContainer"> <ul id="list"> </ul> </div> </body> </html>
596b6f8812f47233579a81bb50ea8698e111636ebdf7c194c8aba539889317a7
['eeadceef35bb46f7b4c2aee69b7e767c']
window.onload = function() { var text_max = 200; $('#count_message').html('0 / ' + text_max ); $('#text').keyup (function() { var text_length = $('#text').val().length; var text_remaining = text_max - text_length; $('#count_message').html(text_length + ' / ' + text_max); });} I have this script that's counting characters in textarea. But its implemented in textarea where is already something writen. simply, i just wondering how to make this script check for characters on page load and not after i press something. i mean. when i reload page there is 0/200 character remaining but there are already like 150 characters in that textarea
1e4d432afc6e18a55348ea329248fc175b765f9db2f0daf5327fe1b27c46f8fd
['eebe27405a5144df8edfab1bd4a79ccf']
As said, you should use DependsOnTargets. I've done some research on MSBuild scope, you can find my results on my blog : http://blog.qetza.net/2009/10/23/scope-of-properties-and-item-in-an-msbuild-script/ The thing is there seems to be a global scope for the project and a local scope for the target . When entering the target, the global scope is copied and when exiting the target, the local scope is merged back. So a CallTarget will not get the modified local scope values but the DependsOnTargets will since the first target is exited before the entering the second target.
4a09f45d369a8b86ab1995f1e1e3d6bc4b8ec6c7ae55522074f1133e4d746211
['eebe27405a5144df8edfab1bd4a79ccf']
So lately I noticed that the Coplanar Waveguid calculations of AppCAD (http://www.hp.woodshot.com/) did not give the same result as the online calculators do. https://chemandy.com/calculators/coplanar-waveguide-with-ground-calculator.htm http://wcalc.sourceforge.net/cgi-bin/coplanar.cgi AppCAD: Can anyone explain this? P.S. this is the same for the microstrip calculations. Does anyone has any experience which calculator works more accurate?
44f08de99c8354790a5b2d3fd6800af7d0f76d96d24b50b7ae07d0180400a918
['eed15eabf0914cfa90695c83c4ea5874']
I get a error when after I published the app. Even on the same computer that I devolved on. While developing everything worked fine. The system cannot find the path specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The system cannot find the path specified. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x80004005): The system cannot find the path specified. ] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +126 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +315 [CrystalReportsException: Load report failed.] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +503 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1495 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +99 ProductionTracker.Web.Reports.CrystalReportGenerator.GenerateReportInPDF(DataTable tb, String reportName) in C:\Users\barry\source\repos\ProductionTracker.Web\ProductionTracker.Web\Reports\Controller\CrystalReportGenerator.cs:37 System.Web.Mvc.<>c__DisplayClass1.<WrapVoidAction>b__0(ControllerBase controller, Object[] parameters) +18 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35 System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39 System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +77 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +387 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +602 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128 I tried this https://stackoverflow.com/a/14602748/10852981 and I cant figure out where to add this in my mvc app. I checked the permissions on the files and allowed to everyone. I included the .rpt file in project. Im not sure what else i should do. This is the code I have for downloading the file public static void GenerateReportInPDF(DataTable tb, string reportName) { using (var reportDocument = new ReportDocument()) { var reportPath = HttpContext.Current.Server.MapPath("~/") + "Reports//" + reportName; reportDocument.Load(reportPath); reportDocument.Database.Tables[0].SetDataSource(tb); reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, HttpContext.Current.Response, false, reportName); reportDocument.Close(); } } This line ProductionTracker.Web.Reports.CrystalReportGenerator.GenerateReportInPDF(DataTable tb, String reportName) in C:\Users\barry\source\repos\ProductionTracker.Web\ProductionTracker.Web\Reports\Controller\CrystalReportGenerator.cs:37 looks wrong because its from my development repo. But im not sure what to do about it.
97a3b72033ce929240c37c58b81268643cbb013ee572cc35a756f796d7816525
['eed15eabf0914cfa90695c83c4ea5874']
I couldnt find a exact answer to this question. I found a bunch of different questions. I finally was able to piece together by using fetch. You need to accept type 'arraybuffer', then you turn into a blob with resopnse.blob(). Then you can open the blob in a new window. fetch('/post/url', { method: 'POST', headers: { Accept: 'arraybuffer', 'Content-Type': 'application/json', }, //you need to use json here body: JSON.stringify({ items: [{ ItemId: 3, Quantity: 40 }], fileId: 2 }); }) .then(response => response.blob()) .then(data => { var popup = window.open(URL.createObjectURL(data), "height=500,width=750); });
3d6a897e50c1bfa5a7bb43f7920831fdb36401fffbfe84819771732148dc31e9
['eed44260fe744046828077e5ccb7b989']
I have built a dynamic library on Mac OS X, a .dylib file, that compiles just fine. In order to run an application using the .dylib some functions in a file named fips_premain.c run before 'main' to check if a fingerprint was embedded in the .dylib properly. All one has to do in the case of a static library is run an executable named incore_macho on the static library and the fingerprint will check out. In the case of the dynamic library I get a failure when I get xcode to run incore_macho on the dylib with the following output: /User/.../Debug/libcompute-osx.dylib is not a mach-o executable file (filetype 6 should be 2) Any thoughts?
2a383de5c62cb80530afa34305cd7b4912e09dd3fb40102ae94520b5056e03e6
['eed44260fe744046828077e5ccb7b989']
When I have my iPhone (which I'll BobbyUserIPhone ) plugged into my Mac the name "BobbyUserIPhone" shows up in the scheme for one of XCode projects. I have another XCode Project open that just "iOS Device" instead of "BobbyUserIPhone" like I would expect. What might cause this and whats the best solution for it?
b9e52792e370de4872c742cc1daf2a6dc713cc4a43a10322d788fc054769fd31
['eed825415e194754adf64dedcb82b85e']
In my javascript console it works when I do this$('.collapse').collapse();, but it does not work when I append it to the bottom of my application.js file. My application.js file looks like this //= require rails-ujs //= require activestorage //= require turbolinks //= require jquery3 //= require popper //= require bootstrap //= require_tree . Why doesn't it work when I add it to my application.js??? Thank you
02df9f25e8303d779bf10b653101d729fd54822e8c0a44c343af2bd8a2e4761a
['eed825415e194754adf64dedcb82b85e']
In Android Studio 3.1.4, as I'm reading some class definitions from android SDK 28, I observe that many import statements cannot be resolved. For example, the class MediaRecorder.java located at AppData\Local\Android\Sdk\sources\android-28\android\media\MediaRecorder.java has import statement import android.annotation.NonNull where instead it should be this: android.support.annotation.NonNull. Many of the sdk classes have import statements errors like this. What suggestions do you propose? Thank you
4a174bafb7d805b6b84e9aa6b647646e2f4c9b4c3c20353fead405fc2f22d0a1
['eed8287282784929ac6d2cdd59dea66b']
My website uses both Jekyll and Bootstrap, and the main navigation header is a dropdown. I would like the parent item (e.g., Solutions) to be highlighted in the header whenever the user is on a corresponding child page (e.g., Solutions > Solution 1). My Jekyll navigation file (navigation.yml) is in the following format: - title: Solutions url: /solutions subpages: - title: Solution 1 url: /solutions/1 - title: Solution 2 url: /solutions/2 - title: Solution 3 url: /solutions/3 - title: Products url: /products subpages: - title: Product A url: /products/a - title: Product B url: /products/b - title: Product C url: /products/c And my navigation HTML file (top-navbar.html) looks like this: <header class="navbar " role="navigation" style="margin-bottom: 0"> <div class="container main-header"> <div class="navbar-header"> <button class="navbar-toggle bar-button" type="button" data-toggle="collapse" data-target=".site-navbar-collapse"> <span class="sr-only">Toggle Navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="/"> <img src="/static/img/logo.png"> </a> </div> <div class="collapse collapse-inverse navbar-collapse site-navbar-collapse"> <ul class="nav navbar-nav navbar-right site-nav"> {% for section in site.data.navigation %} <li class="dropdown " > <a href="{{ section.url }}">{{ section.title }}</a> {% if section.subpages %} <ul class="dropdown-menu " > {% for page in section.subpages %} <li ><a href="{{ page.url }}">{{ page.title }}</a></li> {% endfor %} </ul> {% endif %} </li> {% endfor %} </ul> </div> </div> </header> And the CSS for the site-nav class looks like this: .site-nav:last-child{margin-right:15px;} .site-nav>li>a{padding:10px 17px;color:#545454;} .site-nav>li>a.selected{background-color:#acacac;color:#f9f9f9;} .site-nav>li>a.current{background-color:#acacac;color:#f9f9f9;} Is there a clean way to add highlighting to the navigation header for the parent of the active page?
f063f3a8d08e535953ee401d35f883360fd6d01ba591c2b8b86bcccc7ee02632
['eed8287282784929ac6d2cdd59dea66b']
My sign-up form uses HTML5 validation to validate that required fields have been completed. <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-3"> <form action="https://www.salesforce.com" method="POST" id="signup"> <div class="form-group"> <label for="first_name">First name</label> <input id="first_name" maxlength="40" name="first_name" size="20" type="text" class="form-control" required> </div> <div class="checkbox"> <label> <input id="tou" name="tou" type="checkbox" value="1" required="required"/> I have read and agree to the terms of use. </label> </div> <input type="submit" name="submit" class="btn"> </form> </div> </div> </div> I've replaced the default checkbox with a custom .svg checkbox using CSS. input[type=checkbox] { display: inline-block; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; visibility: hidden; } input[type=checkbox]:before { content: url(/static/img/unchecked.svg); visibility: visible; } input[type=checkbox]:checked:before { content: url(/static/img/checked.svg); } While the HTML5 validation works with other fields, I can't get it to work for the custom checkbox. I tried the methods shown in jQuery validation with custom CSS checkbox without success. Any ideas?
de06fdd5db2b8e77765f84ec101c07edd614772abed956935dc873301a973910
['eedb387e917b42cf8e42116c731285bc']
I need to install Xbuntu 18.04.5 WITHOUT ANY KERNEL, or remove ALL kernels right after installation. The explanation is very simple - the system is supposed to work ONLY with the CUSTOM kernel, compiled specifically for this purpose. Not only do I want to free up some disk space that I will never use, but I also want to not upgrade an unused kernel and avoid the filesystem swelling. But I don't want to crash half the system because of dependencies. Has anyone done something like this?
5778d471e022e8155cf83805b974d414901a4731546c8746d4237d74a761815d
['eedb387e917b42cf8e42116c731285bc']
I'm trying to install freeglut for MinGW on a Windows XP machine. After downloading the sources (from here) I followed these instructions. I opened a MinGW shell and typed the following commands: ./configure make all make install Once done I can't find any freeglut.dll file in the directory. I'm new at installing from sources, and I don't know what I'm missing here. I would like to understand why. Thanks for help.
e8dcfd2bf18d4ebc4cde8c1f1701e267a7f9bd8d08e15c077f792973fedeb23e
['eeead66f3bc74261889b3504aea49ad5']
When i say distributed monolith in that case I'm refering to the fact that if a service fails, all the services that communicate directly with others would also fail. Monoliths are defined by its highly coupled nature, which is also present when microservices communicate directly with each other via http requests. I didn´t say event sourcing automatically makes it loosely coupled, I just said it enables it, as if, gives that possibility. But service decoupling cant be achieved with direct communication between services, right?
e8db38d7608223a75a1d771372b23c9123cc3918439313a739cb34f0ef95c946
['eeead66f3bc74261889b3504aea49ad5']
@c_maker I literally created an account here because I saw someone comment that in a similar question. I initally thought the same "why everyone assumes a service will fail and compromise the whole application? Uptime should be the biggest concern." But then I came to the conclusion that if someone decides to migrate from a monolith to microservices is because they probably want to escape its tightly coupled nature which difficults work division on big teams. Well,direct communication between services is a bit of a step back on that decision I'd say. Still better than monolith but not worth it
f6b7e1d4447e9550059f232252886653cfb91580f92ea1a26bbeba8ad3b39ee1
['eefcb3bfb762481884a81f49ef6c8995']
The memory cells are not the only component inside the SSD. Just because a SSD has double capacity, this does not automatically means it has all other internal components doubled. You just buy more hardware with two independent drives than you would have with the large one. This would result better performance in RAID 0 configuration, but multiple drives also increase the probablility of any single drive failing.
0a9d9f50e275e394c07d1f03928e73802e843d0e8cd1adfefbee7af6e0a832ed
['eefcb3bfb762481884a81f49ef6c8995']
I have two virtual interfaces, one configured as NAT and another as host only adapter. The NAT interface is intended to provide Internet access from inside the virtual box (to pull Docker images, etc) while the host only adapter is for communication between host and quest. My /etc/network/interfaces is auto enp0s8 iface enp0s8 inet static address <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS> gateway <IP_ADDRESS> auto enp0s3 iface enp0s3 inet dhcp I am using Oracle VM VirtualBox Manager 5.2.18_Ubuntu. The guest is Ubuntu Server 5.0.0-13-generic, the host is Ubuntu Mate 4.18.0-18-generic. The NAT interface (enp0s3) works correctly as long as the host only interface (enp0s8) is down. As soon as I put the second interface up (with ifup), the Internet stops being accessible. It is nicely accessible again as soon as I put the second interface down but I need both working at the same time. With both interfaces up, ifconfig on the virtual machine gives enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS> enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS> How can the machine confuse <IP_ADDRESS> with <IP_ADDRESS>? Ifconfig on host gives eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS> lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet <IP_ADDRESS> netmask <IP_ADDRESS> vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet <IP_ADDRESS> netmask <IP_ADDRESS> broadcast <IP_ADDRESS><PHONE_NUMBER> netmask 255.255.255.255 broadcast <PHONE_NUMBER> gateway 193.168.56.1 auto enp0s3 iface enp0s3 inet dhcp I am using Oracle VM VirtualBox Manager 5.2.18_Ubuntu. The guest is Ubuntu Server 5.0.0-13-generic, the host is Ubuntu Mate 4.18.0-18-generic. The NAT interface (enp0s3) works correctly as long as the host only interface (enp0s8) is down. As soon as I put the second interface up (with ifup), the Internet stops being accessible. It is nicely accessible again as soon as I put the second interface down but I need both working at the same time. With both interfaces up, ifconfig on the virtual machine gives enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask <PHONE_NUMBER> broadcast 10.0.2.255 enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet <PHONE_NUMBER> netmask 255.255.255.255 broadcast <PHONE_NUMBER> How can the machine confuse 10.0.2.15 with <PHONE_NUMBER>? Ifconfig on host gives eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.43 netmask <PHONE_NUMBER> broadcast <PHONE_NUMBER> lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 193.168.56.1 netmask <PHONE_NUMBER> broadcast <PHONE_NUMBER> Most I was able to do is to add the routing rule to enp0s3 so that the guest can be accessed from host at localhost rerouted port. I however would still like to understand what is going wrong and how to get both interfaces working.
4a20bdc72de719d33db52516866747e16ac81bea45cab1f61a4b9c83214f316e
['ef02a630249543c0b832d35180b7e8d4']
Given a very large number(N)(say it has 500 digits) we have to count number of pairs of integers x and y such that 0 <= x < y <= N, and sum(x) < sum(y), where sum(k) = sum of digits of number k. Source : here As always I dont't expect a good tutorial from Hackerrank so I asked here, any pointers will be of great help. PS : Contest is over now. Thanks.
cfe0dc4fcd82f92876c1609834aa890b2951ff6a945c59e035aab52f1217b394
['ef02a630249543c0b832d35180b7e8d4']
I'd like to implement a customized content assist (aka. auto-completion) for my Java API's and custom jsp tags. Basically, I'd like to set the advisory level (discouraged use) on the undocumented features. (Of course, the proper way is to expose api's through a facade. However, it's way to late for that and the only way is damage control). What is the proper way to implement customized content assist for Java/JSP as part of an existing plugin? Many thanks, <PERSON>
607b4bb3b93c23d348ff871569a23b0372a0cbd43845fd7bc6277dc252046914
['ef0a4f721ac74784b5741414b41c6d4b']
When I copy the name of a file called "A B" it only search for "A" everything after the space get ignored. Is there a way to add "+" between the words. Set WshShell = CreateObject("WScript.Shell") Set X = CreateObject("htmlfile") text = X.ParentWindow.ClipboardData.GetData("text") WshShell.Run "cmd.exe /k start www.google.com/search?q="+text & Chr(34),0 Set WshShell = Nothing
f8f1559c96474a13afbccf0e0c0b9f0cf485c1527c1d13cf077a2bd8517dc059
['ef0a4f721ac74784b5741414b41c6d4b']
Thanks to <PERSON>, Set WshShell = CreateObject("WScript.Shell") Set X = CreateObject("htmlfile") text = X.ParentWindow.ClipboardData.GetData("text") text = Replace(text, " ", "+") WshShell.Run "cmd.exe /k start www.google.com/search?q=" & text, 0 Set WshShell = Nothing Set re = New RegExp re.Pattern = "\s+" re.Global = True Set WshShell = CreateObject("WScript.Shell") Set X = CreateObject("htmlfile") text = X.ParentWindow.ClipboardData.GetData("text") text = re.Replace(text, "+") WshShell.Run "cmd.exe /k start www.google.com/search?q=" & text, 0 Either of these two codes will work.
3ce29206e65c7f6722a8707ee31c7b4cd7cc07d10e655708320a5adaad169d02
['ef24a50d7ecc49cb9a58ea0d355e4099']
Your problem might come from your use of shmat. In C, never cast the return type of such a function. That you felt the need for it probably means that you had a spurious error message that came from the fact that you are missing the "sys/shm.h" header. What happens in such cases is that gcc takes the return type for an int, usually a 32 bit quantity, and re-interprets it as a pointer. So the upper half of your address that shmat gives you is lost. As a general rule, don't cast away problems. Cast are rarely needed in C if all your headers are properly written. Casting the return type of a system function is almost always wrong.
171eba97d454af48bfe87387ac3cc71cd399069e0d993573b2326e6b23fdc71a
['ef24a50d7ecc49cb9a58ea0d355e4099']
In C, this can be achieved with macros. The implementation of such a thing is a bit tricky, so you'd better use an existing toolbox to do so. I have collected such things in P99. With that you could define something like #define DumpData(...) P99_CALL_DEFARG(DumpData, 3, __VA_ARGS__) #define DumpData_defarg_2() 0 The first line declares a macro that is supposed to receive 3 parameters. The second line substitutes a 0 in place of parameter 2, if that one is omitted (parameter count starts with 0). Such a macro can in fact be named the same as your function, all of this is then transparent to the user at the calling side.
beb69eb82a1906f3341c7f93476a43dc7db5d854ead7f3c4b5cab0cc5d511060
['ef31a31522524d4fa26f0253408479df']
Please i need help on this. I am using stipe elements form , and while it is displaying on development, it does not display on heroku production and this is the error Inspect Element is giving me => ReferenceError: Card is not defined i have no idea, so need help please. i am on Ruby 2.3 & Rails 5.2.3 document.addEventListener("turbolinks:load", function() { const public_key = document.querySelector("meta[name='stripe-public-key']").content; const stripe = Stripe(public_key); const elements = stripe.elements(); const style = { base: { color: '#32325d', lineHeight: '32px', fontFamily: '"Helvetica Neue", Helvetica, sans-serif', fontSmoothing: 'antialiased', fontSize: '18px', '<IP_ADDRESS>placeholder': { color: '#aab7c4' } }, invalid: { color: '#fa755a', iconColor: '#fa755a' } }; const card = elements.create('card', {style: style}); card.mount('#card-element'); card.addEventListener('change', ({error}) => { const displayError = document.getElementById('card-errors'); if (error) { displayError.textContent = error.message; } else { displayError.textContent = ''; } }); const form = document.getElementById('new_job'); form.addEventListener('submit', async (event) => { event.preventDefault(); const {token, error} = await stripe.createToken(card); if (error) { // Inform the customer that there was an error. const errorElement = document.getElementById('card-errors'); errorElement.textContent = error.message; } else { // Send the token to your server. stripeTokenHandler(token); } }); const stripeTokenHandler = (token) => { // Insert the token ID into the form so it gets submitted to the server const form = document.getElementById('new_job'); const hiddenInput = document.createElement('input'); hiddenInput.setAttribute('type', 'hidden'); hiddenInput.setAttribute('name', 'stripeToken'); hiddenInput.setAttribute('value', token.id); form.appendChild(hiddenInput); ["brand", "exp_month", "exp_year", "last4"].forEach(function(field) { addFieldToForm(form, token, field); }); // Submit the form form.submit(); } function addFieldToForm(form, token, field) { var hiddenInput = document.createElement('input'); hiddenInput.setAttribute('type', 'hidden'); hiddenInput.setAttribute('name', "user[card_" + field + "]"); hiddenInput.setAttribute('value', token.card[field]); form.appendChild(hiddenInput); } }); I actually wanted the stripe element form to display on heroku production as on development on localhost.
bd0b4c4141bdde198cca6e8698041c827e4825db8023f8414138ead23bf9eb0a
['ef31a31522524d4fa26f0253408479df']
Please i need help validating this code. Using Ruby 2.3.3 & Rails 5.2 i think all ending anchors are given though <% if current_user.id != user.id %> <div class="panel panel-default"> <div class="pane-body"> <center> <% if !current_user.following?(user) %> <%= form_for(current_user.active_relationships.build) do |f| %> <div><%= hidden_field_tag :followed_id, user.id %></div> <%= f.submit "Follow", class: "btn btn-primary" %> <% end %> <% else %> <%= form_for(current_user.active_relationships.find_by(followed_id: user.id), html: {method: :delete}) do |f| %> <%= f.submit "Unfollow", class: "btn btn-default" %> <% end %> </center> </div> </div> <% end %>
f2c25bd77ec5b542d61198d37f0cb55413450ac7eaea4dadfe861d4ee0786878
['ef3fcd84175e4dda94aecb15c8f65852']
Woa! a year later, but what you are loking for is osmething near this: Go to the dimension sheet, then select the Category Dimension, and click on the Edit Dimesnion button there you can use something like this: = If(Match(Category, 'a', 'b', 'c'), Category, Null()) This will make the object display only a b and c Categories, and a line for the Null value. What leasts is that you check the "Suppress value when null" option on the Dimension sheet. c ya around
a400a30f92858f25e063a37936c6c959784c34d2f17286bc555d974180986a49
['ef3fcd84175e4dda94aecb15c8f65852']
in addition to @iddlefingers answer, here is a view of the log of the application (striping some useless params due to explanation purposes) Parameters: {"utf8"=>"✓", ..., "comentar"=>"Confirmar"} where we can see that comentar is the name of the parameter, and "Confirmar" is it's value, which is the button's text too. which was obtained by submit_tag "Confirmar", :name => 'comentar' So in general you could have (if you want to reduce the number of params you are working with) several submit_tag "onevalue", :name => 'SAMEname', submit_tag "othervalue", :name => 'SAMEname'... and retrieve them in your controller if params[:SAMEname] == "onevalue" # do stuff elsif params[:SAMEname] == "othervalue" #do different stuff end
15ae84f47f601f4162dac352b03312f5e41afe980a47898425a292b35c3d00e2
['ef4d6b92b7204d51a5c595bd38344674']
I'm having trouble simply showing the contents of my List in the ComboBox using Caliburn.micros BindableCollection. I get three blank options, but when I chose one of them I get the correct value back so I know it's working. Obviously I would also like to see what it is I'm choosing. I've tried creating a local string and having it = myList[i] in a for loop. I've even created a random string and tried binding it to my TextBlock using the same naming convention, but I just can't get it to work. I won't add that here since it doesn't work. Hopefully one of you can nudge me in the right direction. I'm new to Caliburn, MVVM, binding, etc.... public List<string> languages = new List<string> {"ENGLISH", "SPANISH", "CHINESE"}; public BindableCollection<string> Language { get; set; } public SettingsViewModel() { Language = new BindableCollection<string>(); for (int i = 0; i < languages.Count; i++) { Language.Add(languages[i]); } } //XAML Code\ <ComboBox ItemsSource="{Binding Language}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding LanguageOptions}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox>
4fc4014da1b18e6bed4d801829698ba36c97f2a60dc03fb5633ff5f8465f4dc1
['ef4d6b92b7204d51a5c595bd38344674']
been trying to figure this out for a while now to no success. I dragged the image tool on the MainPage and named it MyImage. XAML: <Image x:Name="MyImage" Source="Assets/luigi.jpg" HorizontalAlignment="Left" Height="100" Margin="285,400,0,0" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.587,0.507"/> C#: private void ImageCheckBox_Tapped(object sender, TappedRoutedEventArgs e) { MyImage.Source = I CAN'T FIGURE OUT WHAT TO DO HERE; } As you can see I added the image Assets/luigi.jpg in the XAML code, but I want to use a checkbox event to add the image and for that I'll need to do it in C#. I already got the result I wanted by just setting the opacity of the image to 0% and then Changing it to 100% when I click on the checkbox, but I would like to add the image through C# mainly as a learning exercise.
fd75163093919a7a691bddea2c51b430f7e08201c20d663fee52b37a8e25b4fb
['ef551848eb0449109e89ae724e4b9cf5']
I'm using OpenTK and C#. I'm rendering to a renderbuffer and I need to copy it's contents(ColorAttachment0) to a Texture2D so I can do some post-processing on it, and the draw it to the screen. How do I do this? I would use texture instead of a renderbuffer, but I need to Anti-alias the framebuffer, and using GL.RenderbufferStorageMultisample is the only way I know how to.
48986526dc52abe4398b210ed6d5afe73b729a413695e09041fcafa39678b351
['ef551848eb0449109e89ae724e4b9cf5']
I am helping with documentation for a hardware product that is compatible with Fat32 Formatted USB sticks. Instead of saying "Fat32" and confusing users who may not be tech-savvy, we'd like to provide a list of compatible drives and brands. Rather than researching each product separately, we hope that there is a smaller set of USB Controller Chips that determine the drive format, and that there might be a mapping from a few of these (e.g. "Fat32" controller chips) to products currently use them. Does such a mapping exist?
9c5de6de373d07d1e2b703df91a1edb92cd2f1f8916c785158530a6c48871ace
['ef58286df464436ba0dabae2a54a1bec']
I'm trying to calculate the distance between sequential points and partitioned by the ID number in BigQuery. Here's what my table looks like: OBJECTID ID DateAndTime Lat Long 1 1 2002-11-26T12:00:00 <PHONE_NUMBER> -109.9709871 2 1 2002-11-29T13:00:00 38.541137 -109.677575 3 2 2002-11-03T10:00:00 38.550676 -109.901774 4 2 2002-11-04T10:00:00 38.53689 -109.683531 5 2 2002-11-05T10:00:00 38.45689 -109.683531 Based on the above table, I'd want the query to calculate the distance between ObjectID 1 & 2, and then the distance between ObjectID 3 & 4 and then 4 & 5 Here's a query I've started for ordering by DateAndTime and finding the time difference. In this query I was trying to find time differences over 12hours. Is it similar logic to this? How can I calculate distances between sequenced points in BigQuery? SELECT *, DATETIME_DIFF( prev_DateAndTime, DateAndTime, hour) as diff_hours FROM (SELECT points.ID, points.DateAndTime, LAG(DateAndTime) OVER (PARTITION BY points.ID ORDER BY points.DateAndTime) as prev_DateAndTime FROM `table1` AS table1 INNER JOIN `table2` AS points ON table1.ID = points.ID WHERE (points.DateAndTime BETWEEN table1.BeginDate AND COALESCE (table1.EndDate, CURRENT_DATE() + 1)) And points.DateAndTime between '2020-12-01T00:00:00' and CURRENT_DATE() ) d WHERE DATETIME_DIFF(prev_DateAndTime, DateAndTime, hour) > 12
c7dea46b6c1fef13d82894f9865ab784c4c3f0420a1cdcff715ff926d62c2247
['ef58286df464436ba0dabae2a54a1bec']
I ended up using an update cursor to solve my issue. with arcpy.da.UpdateCursor(fc, fields) as cursor: for row in cursor: myDate = datetime.strptime(datetime.strftime(row[0], "%m/%d/%Y"), "%m/%d/%Y") if (myDate >= datetime.strptime("03/30/2020", "%m/%d/%Y") and myDate <= datetime.strptime("04/13/2020", "%m/%d/%Y")): row[1] = "SPRING" elif (myDate >= datetime.strptime("04/14/2020", "%m/%d/%Y")and myDate <= datetime.strptime("10/31/2020", "%m/%d/%Y")): row[1] = "SUMMER" elif (myDate >= datetime.strptime("02/06/2020", "%m/%d/%Y") and myDate <= datetime.strptime("01/10/2020", "%m/%d/%Y")): row[1] = "FALL" elif (myDate >= datetime.strptime("02/10/2020", "%m/%d/%Y")): row[1] = "WINTER" cursor.updateRow(row)
945206bc6a902d4873ea349bf42f2e7334d89c087dd8f4c7222a7c4865b316fd
['ef58501058984ffc8983320c875a97b2']
Thanks for this helpful result, which I could not find elsewhere. For the common case of $n=2$, it simplifies as follows: To map from $ds^2 = a^2 \left(d\theta^2 + \sinh^2 \theta d\phi^2\right)$ to $ds^2 = \frac{a^2}{y^2}\left(dx^2 + dy^2 \right)$, use the transformation $x = \frac{\cos\phi \sinh \theta}{\cosh \theta - \sinh \theta \sin \phi }$, $y = \frac{1}{\cosh \theta - \sinh \theta \sin \phi}$.
a6f10f4501cc55bfa928c4c5285530d85cfa85c71ac503f31bbd213f99db777f
['ef58501058984ffc8983320c875a97b2']
Я разместил на ViewController TableView, а на ней TableViewCell. Хочу вызвать саму tableView, чтобы у нее вызвать indexPathForSelectedRow, но он не находит tableView. Что сделать в данной ситуации? """ override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showDetail" { guard let indexPath = 'tableView.indexPathForSelectedRow' else { return } let place = places[indexPath.row] let newPlaceVC = segue.destination as! NewPlaceTableViewController newPlaceVC.currentPlace = place } } """
8829a8f463c29a17224dc5c25719f69df444c58bc4c7da762b5e71347cf7b929
['ef5bd8ad150646f0a9927b34e9050fdf']
Now I am writing a WMI query utility following the examples provided in this link: http://msdn.microsoft.com/en-us/library/windows/desktop/aa390422(v=vs.85).aspx But I find that the program may blocking on the call to IWbemLocator<IP_ADDRESS>ConnectServer. Here is the code: hres = pLoc->ConnectServer( _bstr_t(L"\\\\COMPUTERNAME\\root\\cimv2"), _bstr_t(useToken?NULL:pszName), // User name _bstr_t(useToken?NULL:pszPwd), // User password NULL, // Locale NULL, // Security flags _bstr_t(useNTLM?NULL:pszAuthority),// Authority NULL, // Context object &pSvc // IWbemServices proxy ); My question is how can I set a time out option, before calling IWbemLocator<IP_ADDRESS>ConnectServer.
a0f707f80174144d0b8a64d8b7b33231a637d08fb1337b39c31849a94a959716
['ef5bd8ad150646f0a9927b34e9050fdf']
I just start to learning mips assembly programming and use QtSpim emulator. The example code is copied from a tutorial. But when loaded using QtSpim, it complains following error: spim: (parser) syntax error on line 6 of file /home/k/Desktop/work/asm/h3.asm la $t0, value The exmple code: 1 # add two numbers 2 .text 3 .globl main 4 5 main: 6 la $t0, value 7 lw $t1, 0($t0) 8 lw $t2, 4($t0) 9 add $t3, $t1, $t2 10 sw $t3, 8($t0) 11 12 .data 13 value: .word 10, 20, 0 14
43c11ec22cdae3b4ac4ec7fc3f63385e40b866897c17c29a58656a13d4e23978
['ef603632b914455b8c4a3eb7bcf6857f']
This may sounds crazy but it seems unclear to me whether there is an interface to assembly programmers to write code to load one register on core 1 to a register on core 2. For example, load EAX on core 1 to EAX on core 2. Is it even possible? More over what is the interface to assembly programmers to use two cores (run code on more than one core)?
e70599999b6a51887ba098db550419b6f62029ca13b9330087ca9d1826709b4d
['ef603632b914455b8c4a3eb7bcf6857f']
One way to do this is run a WCF service on your server to do the Speech recognition using Microsoft Speech Recognition API (SAPI) and let your web service to talk with your WCF Service . Basically, the web service needs to get the audio, stream it and send it to the WCF service. YOu can find more information on this post: http://blog.renzuocheng.com/2011/03/speech-recognitionsapi-in-asp-net2/
7ff2becfe101f89068da8d5952d69b9674f4bfce4662e499bbbcc53118af9e54
['ef72751497214affbf81265c42404686']
I am getting following error when I run code in Selenium and Java using TestNG. On multiple blogs/sites it is mentioned to clean the project and so I did Project->Clean but still it is throwing me this error. Can some one please point me what is wrong in this code? Thanks. package firsttestngpackage; //import org.testng.annotations.Test; //import org.openqa.selenium.*; import org.testng.Assert; import org.testng.annotations.*; //import org.testng.asserts.*; //import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class FirstTestNGFile { @BeforeSuite public void SetBrowser(){ System.setProperty("webdriver.chrome.driver", "C:\\chromedriver_win32\\chromedriver.exe"); } public WebDriver driver1 = new ChromeDriver(); public String baseurl = "http://newtours.demoaut.com/"; public String ExpTitle = "Welcome: Mercury Tours"; @Test public void CheckPageTitle() { driver1.get(baseurl); String ActTitle = driver1.getTitle(); Assert.assertEquals(ActTitle, ExpTitle); driver1.quit(); } } Exception: org.testng.TestNGException: Cannot instantiate class firsttestngpackage.FirstTestNGFile at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38) at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387) at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299) at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110) at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186) at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120) at org.testng.TestRunner.initMethods(TestRunner.java:409) at org.testng.TestRunner.init(TestRunner.java:235) at org.testng.TestRunner.init(TestRunner.java:205) at org.testng.TestRunner.<init>(TestRunner.java:160) at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:141) at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:271) at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:561) at org.testng.SuiteRunner.init(SuiteRunner.java:157) at org.testng.SuiteRunner.<init>(SuiteRunner.java:111) at org.testng.TestNG.createSuiteRunner(TestNG.java:1299) at org.testng.TestNG.createSuiteRunners(TestNG.java:1286) at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29) ... 21 more Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html at com.google.common.base.Preconditions.checkState(Preconditions.java:197) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117) at firsttestngpackage.FirstTestNGFile.<init>(FirstTestNGFile.java:21) ... 26 more
a53199b828f308ac9f3689001c80a5c397323428b3f6a937d6e1615ddf8ea3f0
['ef72751497214affbf81265c42404686']
I am getting following error. I have Eclipse Mars and JRE V 1.7 (i initially had installed V1.8 but as it was not compatible so uninstalled and installed this version.) I am facing this issue when invoking Eclipse itself. eclipse.buildId=4.5.0.I20150603-2000 java.version=1.7.0_80 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US !ENTRY org.eclipse.osgi 4 0 2015-07-14 11:20:39.006 !MESSAGE Error reading configuration: Unable to create lock manager. !STACK 0 java.io.IOException: Unable to create lock manager. at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:698) at org.eclipse.osgi.storage.Storage.getChildStorageManager(Storage.java:1750) at org.eclipse.osgi.storage.Storage.getInfoInputStream(Storage.java:1767) at org.eclipse.osgi.storage.Storage.<init>(Storage.java:127) at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:86) at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:75) at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31) at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:295) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
ead1f558a3160486d71d35cb3ca1cab7d40c16d12e1fd623d91fd0ee9025d188
['ef7bf8dda4414688961175ff5d335f5c']
This is possible but you will have to do native implementations to access the specific platform apis. For Android you will need to use WifiManager (https://developer.android.com/reference/android/net/wifi/WifiManager) and for iOS you could possibly use NEHotspotConfiguration (https://developer.apple.com/documentation/networkextension/nehotspotconfiguration). I have used WifiManager for Android to connect to a specific Wifi network programmatically.
10fb82a8fcfee78881ee5b6ddeede6c753779515f76b03421162b76c2e836aec
['ef7bf8dda4414688961175ff5d335f5c']
From experience I can tell you that Azure does provide a few options that would allow you to work with geospatial data. The first is Cosmos DB (DocumentDB) and it nicely integrates with Xamarin (https://learn.microsoft.com/en-us/azure/cosmos-db/mobile-apps-with-xamarin) The second would be Azure Search. The advantage here is that you can use different types of data-sources to work with. (https://azure.microsoft.com/en-gb/resources/videos/azure-search-and-geospatial-data/) I hope that helps.
60ae9de7752a1b160d4b71a5e86e5e8c9f8c72353f82c61b83ec398d72b01ea3
['ef85ce8a57014dd5be5edf32d8e3a316']
MATLAB introduced a new way of animating lines, starting with version R2014b, called animatedLine. Here's how you can use it to draw the vertical line in your question. x = 0; h = animatedline(); set(gca,'ylim',[0 10],'xlim',[-5 5],'box','on'); for y=0:0.0001:10; addpoints(h,x,y); drawnow update end Adjust the step size (0.001 in this example) to increase or decrease your animation speed as necessary. To get a set frames per second you will want to look into a timer callback instead.
ac89ba4d12b2a7fca6b2820ec5e992effdfac3d2f74b885fcc46d9bb1de9d09e
['ef85ce8a57014dd5be5edf32d8e3a316']
You should have two files created with GUIDE. For the sake of example, let's say your's are named raimo.fig and raimo.m. Let's also say you gave your uitable the tag, 'table_1'. If you edit the raimo.m file, you should see a line like this % --- Executes just before analysis is made visible. function raimo_OpeningFcn(hObject, eventdata, handles, varargin)` Load your data from the file within this function, and then give it to your user data. Here's a made up example of how to do it: a = load('yourAmbiguousData'); set(handles.table_1,'table',a); I don't know how your data is saved, or what is called, but if you have pulled it out of your uitable correctly, you can just put it back in there with a set command.
798f8a69f84627616c48730ab5d557c047c1457bb914beb7c3cea16b53c8c3fa
['ef893428c4ee4c2c8c11c926cf448773']
The problem is here: if node not in path: # Search the paths of that new node newpaths = find_all_paths(node, end, path) # Append new path to paths for newpath in newpaths: paths.append(newpath) if node is already in path, the old newpaths will be used. All you need is to move the for loop under the if statement: if node not in path: # Search the paths of that new node newpaths = find_all_paths(node, end, path) # Append new path to paths for newpath in newpaths: paths.append(newpath) or: if node not in path: # Search the paths of that new node paths += find_all_paths(node, end, path) Also, I would recommend using defaultdict(set) instead of lists.
820cda530c68b6dcad5278c57841c7f17f374fc9a90ba8753ed5ca974469e9e3
['ef893428c4ee4c2c8c11c926cf448773']
Here is a reference implementation from one of my projects. It prints dots instead of a spinner, but it is trivial to change: import threading import time def indicate_wait(func): active = threading.Lock() def dot_printer(): while active.locked(): print('.', end='', flush=True) time.sleep(1) def wrapper(*args, **kwargs): t = threading.Thread(target=dot_printer) active.acquire() t.start() res = func(*args, **kwargs) active.release() return res return wrapper Example: @indicate_wait def test(): time.sleep(5)
fbaed2468b8210db919e067a45d5af540a57e8fdbb0f40b968a1485b267a1f34
['ef9326d17a434611bb3c4d1b6e12b8e4']
Let's take an example: Suppose that at the begining of the history p=q=0.5; If the system outcomes is 1, the probability to get 1 in the next step now it's not just p, but k\*p (k>1, but close to 1). The probability to get another 1, is k\*k*p, and so on. The same for 0. So, in general, if the current outcome is 'x', the probability to get another 'x' in the next step is k^n * p, where n is the number of consecutive 'x'-s until the next phase. Maybe, this is a <PERSON> chain but I don't know how to predict the system outcome in a <PERSON> process. Thank you for answering.
c25e664f91be78a68042f25a2fbcb46004a1bbbea208393c56698f9f19822726
['ef9326d17a434611bb3c4d1b6e12b8e4']
You are right. Actually, the given problem says that B is in the upper $circle$ and C in the bottom one. This phrase means that they are in the parameter line. One last clarification... Is there a theoreme that says that the perpendicular radius cuts a segment between 2 different perimeter points of the circle in half?
eaac05b011620ef14f4c401f66351adec5833d3d6c38019bcff10fcf2dbf6373
['ef9635e8080847c4b79a0248aeb87c76']
"In other words, mankind deserves to be punished but <PERSON> gets punished for us." No, neither <PERSON>, <PERSON>, <PERSON>, or <PERSON> taught this. Protestants taught this, but they were declared heretical in oart for this by the largest Western branch: Latin Catholicism. To combine this Calvinist view with the Roman Catholic view is more than misleading.
68689de819d1ea4ad33b6f44753d5445323f3fa2d38ee6297980abcb8edb757e
['ef9635e8080847c4b79a0248aeb87c76']
Are you sure you want ERP? Sounds more like your looking for an accounting tool. Anyways, the single best resource for ERP processes ( and tools built around them) that I know of is <PERSON> - http://en.wikipedia.org/wiki/Eliyahu_M._Goldratt . His Theory of Constraints has been great and tools built around it are well worth examining
a77920c1f69a2a42687c757bc178d65f6cc1602656fa988aaa4c1548845123b4
['ef9a29634bec462d9faded621a13fc9a']
Desde que empece a programar con python estuve teniendo esta problema, no puedo explicarlo bien así que pondré un programa de ejemplo (me pasa en todos los programas que hago). ejemplo = input('te gusta python?') if ejemplo == 'si' or 'Si' or 'sI' or 'SI': print('a mi también!') elif ejemplo == 'no' or 'No' or 'nO' or 'NO': print('a mi si me gusta') **Consola:** te gusta python?*no* a mi también! Lo intente también en otra versión de python 3 (3.8.0) y seguia. lo mismo. Lo mismo tambien pasa con los else: ejemplo = input('te gusta python?') if ejemplo == 'si' or 'Si' or 'sI' or 'SI': print('a mi también!') else: print('a mi si me gusta')
83892482318efdde73f9905d18e3ddfadab2e0b38897b0ba5ff192cf174ffc2d
['ef9a29634bec462d9faded621a13fc9a']
This is exactly what I'm trying to do "If user input can’t be avoided, ensure that the supplied value is valid". In my case I can't validate based on the target domain, as we do not control these. Further more, the links should work from inside emails; which means that a "GET" request is unavoidable. I know I can implement something with a shared secret, and a server based redirect, but that's what i'm trying to avoid.
04264ffb9ba372c7bd0110322fdbbd04e87f1e85d4593061daac972ac5d74a9c
['efa02bcd75db48ea94464275810047cc']
I am not able to understand what you are trying to achieve What I understood is you are selecting an option in one select bar and another one is also get opened with the same value. Solution:- What I found is you are using the same model for both the select bar: data.singleSelect <select name="singleSelect" ng-model="data.singleSelect"> This is causing issue. Use the different name in ng-model for both the select bar. It will solve the issue.
b3170a6560012ceb741298dc132a2e5929a13bcaab74e2c0d62123afa0bd5b6c
['efa02bcd75db48ea94464275810047cc']
If you will see the SQL query generated by GORM, you will find that the distinct will apply on a complete row instead of the customerName. You can enable the logs by putting logSql = true in datasource.groovy. You can try this def criteria = Order.createCriteria() def orders = criteria.list() { and { eq("showAddress", true) like("customerName", "%abcdPqrs%") } projections { groupProperty("customerName") property("deliveryAddress") property("billingAddress") property("") } }
4fb3e5ddc707fe3bb830f31493943947a7c54b555a4490c5dcb15e3973ea5a5c
['efaa5a66ab5b4fb99b73068497804ac4']
Yes, it is possible. As to whether it's a good idea, this is just my 2 cents... Before the XML datatype came along I worked on a system storing XML in an NTEXT column - that wasn't pleasant, and to get any real use out of the data meant shredding some of that data out into relational form. OK, the XML datatype now makes it easier to query an XML blob and to extract certain values/index them. But personally, in general, I wouldn't. I'm not saying never use XML as there are scenarios for that - rather if that's all your planning on doing then I'd be thinking "is this the right tool for the job". Using a RDBMS as a document database makes me feel a bit uneasy. Whereas something like MongoDB has been built from the ground up as a document database. In all honesty, I haven't done any performance testing on storing data as XML so I can't give you an indication of what performance would be like. Would be interested to know how this performs at scale.
ff7cbd83a3beebb50bdae52c75434e0caa9998bc572fd866de17419ec2118ae4
['efaa5a66ab5b4fb99b73068497804ac4']
Based on my understanding of the question, assuming you have an NVARCHAR column that you are looking at, you could try this example: DECLARE @Data TABLE (Field1 NVARCHAR(100)) INSERT @Data VALUES ('ABC') INSERT @Data VALUES ('123') INSERT @Data VALUES (N'Value with 化ける unicode chars in') SELECT * FROM @Data WHERE Field1 <> CAST(Field1 AS VARCHAR(100)) So this is going to return all records where the VARCHAR (non-unicode) representation does not match the NVARCHAR value - e.g. if the value contains unicode characters, then the VARCHAR representation will not match and hence will return the row
461d9fd3f73d4551c1fa35be1ba60eef77cd82b841de6d28500b65b423a9f5cf
['efaa82bab0ad45b9998c51b064c5d494']
OK. We have table like this CREATE Table MyTbl(id INT PRIMARY KEY IDENTITY(1,1), Code INT, Yr INT, Rate INT) And we would like to calculate cumulative value by Code. So we can use query like this: 1) recursion (requires more resources, but outputs the result as in the example) with cte as (SELECT *, ROW_NUMBER()OVER(PARTITION BY Code ORDER BY Yr ASC) rn FROM MyTbl), recursion as (SELECT id,Code,Yr,Rate,rn, CAST(NULL as int) as Tmp_base, CAST('100' as varchar(25)) AS Base FROM cte WHERE rn=1 UNION ALL SELECT cte.id,cte.Code,cte.Yr,cte.Rate,cte.rn, CAST(recursion.Base as int), CAST(recursion.Base+cte.Rate as varchar(25)) FROM recursion JOIN cte ON recursion.Code=cte.Code AND recursion.rn+1=cte.rn ) SELECT id,Code,Yr,Rate, CAST(Base as varchar(10))+ISNULL(' ('+ CAST(Tmp_base as varchar(10))+'+'+CAST(Rate as varchar(10))+')','') AS Base FROM recursion ORDER BY 1 OPTION(MAXRECURSION 0) 2) or we can use a faster query without using recursion. but the result is impossible to generate the strings like '107 (100+7)' (only strings like '107') SELECT *, 100 + (SELECT ISNULL(SUM(rate),0) /*we need to calculate only the sum in subquery*/ FROM MyTbl AS a WHERE a.Code=b.Code /*the year in subquery equals the year in main query*/ AND a.Yr<b.Yr /*main feature in our subquery*/ ) AS base FROM MyTbl AS b
67b2453bc7a3c222e52074c0d177e35ef0d2fd1f046267405e1129cfab2ce7ae
['efaa82bab0ad45b9998c51b064c5d494']
I have a very big html table generated like this: function getSpeciesRowHtml(row_data) { var html = ""; html = html + '<tr>' + '<td>' + row_data.id + '<input type="hidden" class="species_table_IDs" value="' + row_data.id + '"></td>' + '<td>' + row_data.name + '</td>' + '<td>' + row_data.name_lat + '</td>' + '<td>' + row_data.class + '</td>' + '<td>' + row_data.family + '</td>' + '<td>' + row_data.family_lat + '</td>' + '<td>' + row_data.order + '</td>' + '<td>' + row_data.order_lat + '</td>' + '<td>' + row_data.spec_status + '</td>' + '<td><a class="btn_species_delete">Edit</a></td>' + //delete button '</tr>' ; return html; } function fillTable(data) { var html = ""; $.each(data, function (i, item) { html = html + getSpeciesRowHtml(data[i],true); }); $('#species_table tbody') .prepend($(html)); }; Data for this table comes from database through controller. The fact is that the data can be deleted. For this purpose in each row of the table there is the button "Delete". Delete buttons are initialized by class selector because them very much (a line by line table creation takes a monstrous amount of time): $('.btn_species_delete') .button({ icons: { primary: "ui-icon-trash" }, text: false }) .click(function () { DeleteSpecies(id); }); That is, when you press the "delete" function must be called which should be referred to the "id" property. The problem is that each button has its own unique "id" and I have not idea how to transfer it there. Because initialization of buttons is performed through the whole class. How best to handle this, for this to work as quickly as possible?