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
9949373bb6236666ca8928bbeb64de1e1d4cf52c7948b5a6b1178193f7058219
['b8dbf3a795d749beae30b264ced144b0']
@JonW ok, besides the "moderator part", do you have anything else to actually contribute. Lots of questions end up taking this route, say 1 thing that people disagree on, I can jsut aswel delete the question and re-ask since no one is helping! Answering. Finding a solution to a problem. Please understand that JonW. That is the reason I am asking. Not to waste my time, if I wanted to waste my time, I would rather prefer a game of League of Legends. p.s. before I ask a question, I always search for an answer, just incase you wanted to argue about that! Just a reminder for future, HELP others!
729e33cbfce942416f33b10773af70d9f192a348f863cb936d42cdd87ca172ad
['b8dbf3a795d749beae30b264ced144b0']
I do not have a problem with moderators even though they are mostly, active, but i have a MAJOR problem with people more focused on not helping at all...just read my post again...you clearly do not understand what the reason is for the post. Help some, not downvote and walk away!
284927e6f77b7a4c45e0c18cbf33cccc1e63c9f4fc88603220105f4a00bc8f0e
['b8dc9a9db83543c99dffe6886ce5329f']
Here is a query I made using @Gordon's answer: SELECT DATE(r.created_at), COUNT( DISTINCT CASE WHEN r.rating = 1 THEN user_id ELSE 0 END ) as rating1s, COUNT( DISTINCT CASE WHEN r.rating = 2 THEN user_id ELSE 0 END ) as rating2s, COUNT( DISTINCT CASE WHEN r.rating = 3 THEN user_id ELSE 0 END ) as rating3s, COUNT( DISTINCT CASE WHEN r.rating = 4 THEN user_id ELSE 0 END ) as rating4s, COUNT( DISTINCT CASE WHEN r.rating = 5 THEN user_id ELSE 0 END ) as rating5s FROM ratings r WHERE r.campaign_id = 2 AND DATE(r.created_at) >= '2018-08-01' GROUP BY DATE(r.created_at) This is still not optimized but much better than my initial solution.
a0ebc9f2f227c1eb4705947b1a33a7c240a25d06704103e0ec1d28fb4b6f2374
['b8dc9a9db83543c99dffe6886ce5329f']
I am working on same thing and used POINT data type to store Lat Lng of location. Then I used distance_sphare function to get distance. Below is code for this function in mySQL 5.7 ST_DISTANCE_SPHERE(mysql_column_lat_lng, POINT($lat $lng)) This fuction will return distance in meter but problem is it will return displacement (the shortest distance between two points which is always a line). Getting driving distance is not possible using above method, you will need to call google map api to get driving distance.
8df76203fbe83cd5e2cfd2617da9550d6f5c72a729cfdcf679ef572b6990d38c
['b90668fa4bae45a98d391edf99f88b07']
I have trouble with an SVG. It won't display in html. Not with <img> not with <object> If browse directly to this SVG i can see it. Test: http://angliru.nl/upload/121.svg but when included I only see white, see: http://angliru.nl/test.html What am i doing wrong? I checked these 3 possibilities, but still isnt working: Your server is using the wrong MIME type for SVG images. (Can be fixed by adding AddType image/svg+xml svg to your .htaccess file; other methods discussed here) You saved the SVG file somewhere else and it doesn't exist at icons/chrome.svg. (Try navigating straight to the SVG file at icons/chrome.svg. Does it display in your browser?) You saved the file with insufficient permissions, resulting in your web server being unable to access the file. (Can be fixed by navigating to the icons directory and typing chmod 0644 chrome.svg at the command line prompt.)
06331b446d572a38387e2741a9e806fed48dee61a520644002c2326594d8bc92
['b90668fa4bae45a98d391edf99f88b07']
I've a problem i cant figure out. People access this url: http://www.sub.domain.net/action but they need to be redirect to https://www.domain.net/action/action2 I tried doing this with this line in .htaccess: Redirect http://www.sub.domain.net/action https://www.domain.net/action/action2 But it's not working. I only need this specific url to be redirected, not the entire www.sub.domain.net. Any advice?
9514c6d07e8ab199e0ba4f7ae90cd489384eb302d1da3ac37f4ba1f7e56b7eb4
['b9272a84a1fb45ceb86c22217dbe58d8']
I've attached a Behavior to a button to get both long press and tap gestures public class LongPressBehavior : Behavior<Button> { private static readonly object _syncObject = new object(); private Timer _timer; private volatile bool _isReleased; private object _context; public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(LongPressBehavior), default(ICommand)); public static readonly BindableProperty EarlyReleaseCommandProperty = BindableProperty.Create(nameof(EarlyReleaseCommand), typeof(ICommand), typeof(LongPressBehavior), default(ICommand)); public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create(nameof(CommandParameter), typeof(object), typeof(LongPressBehavior)); public static readonly BindableProperty DurationProperty = BindableProperty.Create(nameof(Duration), typeof(int), typeof(LongPressBehavior), 1000); public object CommandParameter { get => GetValue(CommandParameterProperty); set => SetValue(CommandParameterProperty, value); } public ICommand Command { get => (ICommand)GetValue(CommandProperty); set => SetValue(CommandProperty, value); } public ICommand EarlyReleaseCommand { get => (ICommand)GetValue(EarlyReleaseCommandProperty); set => SetValue(EarlyReleaseCommandProperty, value); } public int Duration { get => (int)GetValue(DurationProperty); set => SetValue(DurationProperty, value); } protected override void OnAttachedTo(ImageButton bindable) { base.OnAttachedTo(bindable); bindable.Pressed += Button_Pressed; bindable.Released += Button_Released; } protected override void OnDetachingFrom(ImageButton bindable) { base.OnDetachingFrom(bindable); bindable.Pressed -= Button_Pressed; bindable.Released -= Button_Released; } private void DeInitializeTimer() { lock (_syncObject) { if (_timer == null) { return; } _timer.Change(Timeout.Infinite, Timeout.Infinite); _timer.Dispose(); _timer = null; } } private void InitializeTimer() { lock (_syncObject) { _timer = new Timer(Timer_Elapsed, null, Duration, Timeout.Infinite); } } private void Button_Pressed(object sender, EventArgs e) { _isReleased = false; _context = (sender as ImageButton)?.BindingContext; InitializeTimer(); } private void Button_Released(object sender, EventArgs e) { if (!_isReleased) { EarlyReleaseCommand?.Execute(CommandParameter); } _isReleased = true; _context = null; DeInitializeTimer(); } protected virtual void OnLongPressed() { if (Command != null && Command.CanExecute(CommandParameter)) { if (CommandParameter == null && Command.CanExecute(_context)) { Command.Execute(_context); return; } Command.Execute(CommandParameter); } } public LongPressBehavior() { _isReleased = true; } private void Timer_Elapsed(object state) { DeInitializeTimer(); if (_isReleased) { return; } _isReleased = true; Device.BeginInvokeOnMainThread(OnLongPressed); } } You can use it as: <Button Text="Long Press Me!"> <Button.Behaviors> <behaviors:LongPressBehavior Command="{Binding LongPressCommand}" EarlyReleaseCommand="{Binding TapCommand}" Duration="5000" /> </Button.Behaviors> </Button>
c5bc43c260e281f916ce5024254750d468538a66adf5dd6144a75ee95ae02ac2
['b9272a84a1fb45ceb86c22217dbe58d8']
You should declare the Grid structure only once, ideally in Constructor (or in XAML which is called in the constructor). Whenever OnAppearing is called, you are adding 2 new rows and 5 new columns to the existing Grid hence its size is reducing. Also, by looking at the elements adding logic you've written, you should probably be using ListView with a Grid ViewCell and set the ItemsSource to an ObservableCollection so that it will update automatically
eb242b229d9533d6b15087b47582d9b07306db24cdff52543e47e80e0beb696d
['b933770d47b74e0a83035c41bf2957f7']
Sackcloth written in revelations is a covering derived from the skins God first placed on <PERSON> and <PERSON>. The first skins were the first sackcloth and a dark day that humans failed in the will of God. Not by written law, but by the pure heart that became dark . A prophet is defined as one set aside for Gods purpose in his will. By knowledge we cannot deny that man and woman were created for Gods purpose, therefore the spirit of man and woman are prophets, not only a male. Now we as Christians cannot deny Gods purpose be made void. Is Revelations written as blessed are they that read, or he?
ad38430952ee386e3f777bc9df7550399bb035eea44dee4826ea854a08294ba9
['b933770d47b74e0a83035c41bf2957f7']
It has already been shut down and we all have turned to other to-do app instead. Currently in the market, you have many choices. Some are even better than Astrid. I am using TickTick now and recommend you to have a try also. https://play.google.com/store/apps/details?id=com.ticktick.task
0537140ab5e96a9fffda2fe9febb5bc4705c6177bb9c1ed0041dbdd4b12f7601
['b9379372ab99423480341c6df11795e1']
I have a new problem. I already done my widget but now i want 5 rating widget's for 5 categories in my database. I have this column in my database (named places.categ): places.categ a b c d a e .... I have 21 markers in my Google Maps and each one of them as a category. (a,b,c,d or e). How can i associate 5 rating widgets to those 21 markers by category? All i could do was this: db.define_table('product', Field('A', 'integer',requires=IS_IN_SET(range(1,6))), Field('B', 'integer',requires=IS_IN_SET(range(1,6))), Field('C', 'integer',requires=IS_IN_SET(range(1,6))), Field('D', 'integer',requires=IS_IN_SET(range(1,6))), Field('E', 'integer',requires=IS_IN_SET(range(1,6)))) I have this code in my models/db.py and this one in my controllers/default.py: from plugin_rating_widget import RatingWidget # Inject the widgets db.product.A.widget = RatingWidget() db.product.B.widget = RatingWidget() db.product.C.widget = RatingWidget() db.product.D.widget = RatingWidget() db.product.E.widget = RatingWidget() # form2 = SQLFORM.factory( # Field('Rating','integer',widget=SQLFORM.widgets.RatingWidget)) # if form2.process().accepted: # print form2.vars.search form2 = SQLFORM(db.product) if form2.accepts(request.vars, session): session.flash = 'submitted %s' % form2.vars redirect(URL('index')) I have 5 rating widget but they are not associated to my database and they are vertical (in 5 lines) and not in 1 line, like i wanted too. TIA. P.S.: I have the plugin rating widget uploaded.
5a675cfd65686f5d38dc48a4b7a0df17ad3d923030f240027e2b946f54633f31
['b9379372ab99423480341c6df11795e1']
I solved in another way. I get colors to each category with this code: var <PERSON> = new google.maps.MarkerImage( "http://labs.google.com/ridefinder/images/mm_20_yellow.png", new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)); var <PERSON> = new google.maps.MarkerImage( "http://labs.google.com/ridefinder/images/mm_20_red.png", new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)); var <PERSON> = new google.maps.MarkerImage( "http://labs.google.com/ridefinder/images/mm_20_green.png", new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)); var <PERSON> = new google.maps.MarkerImage( "http://labs.google.com/ridefinder/images/mm_20_blue.png", new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)); var <PERSON> = new google.maps.MarkerImage( "http://labs.google.com/ridefinder/images/mm_20_white.png", new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)); var <PERSON> = new google.maps.MarkerImage( "http://labs.google.com/ridefinder/images/mm_20_shadow.png", new google.maps.Size(22, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)); I awarded each category in one of this colors (example): if (placescoordjs[i][4]== 'a') { marker = new google.maps.Marker({ position: new google.maps.LatLng(placescoordjs[i][1],placescoordjs[i][2]), icon: <PERSON>, shadow: <PERSON>, map: map, title: placescoordjs[i][3] }); google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.setContent(placescoordjs[i][0]); infowindow.open(map, marker); } })(marker, i)); } I have more 3 "else if" and the final else with the final color to my last category. Thanks anyway. ;)
2e362d9460f09d394848ed7e011cad8ece03aaddd0610bc1d3611db10ff55e68
['b95f8d914bc44b9888eaf4f442699e19']
I am working in power grid systems, which has many nodes and the connections between them are like edges in the graph. The nodes in the grid becomes online and offline and therefore a graph discovery is needed. Similarly, the distance from the supply to the outer nodes plays a significant role.
08d90905e061448860e5eb7dc08823be12c1f20ef14e2f83f0598a65f5da1c7c
['b95f8d914bc44b9888eaf4f442699e19']
If the auto-discovery uses Bonjour / multicast DNS, it will work fine. That also applies to the network speaker if it’s, e.g., AirPlay. Otherwise, the network speaker should continue to work over the existing <IP_ADDRESS><PHONE_NUMBER> network, which isn’t being changed, unless it needs to access the NAS in which case things get slightly more complicated!
8bb28c64563aef115201f0805e23c5b981e682d11e634bcb62a20808166c7942
['b96a1beb4c2948d0bd8e4ba0a0b9a6db']
Yes, it's generally pages that use JS for obnoxious reasons, for instance initially displaying the content and then deciding they don't like the fact I use an adblocker so will yank the content and replace it with a whinge. If the original use of JS isn't obnoxious, then I probably don't want to kill it off.
8666a825f5a2d8ea1ebb1addf09d2eed5d472ef07853ccd39e58b2a470132e4f
['b96a1beb4c2948d0bd8e4ba0a0b9a6db']
I've never ordered home food where I live, and certainly not in the USA. One thing that truly worries me is the "trust factor"; not only do I have to trust the restaurant's personnel to not spit in my food or otherwise soil it, but I also have to trust the person delivering it, who is more than likely to not exactly love his job/life, and might very well do something to my food out of spite, especially if they decide they don't like me for whatever reason. An extremely cheap and elegant solution would be for the food place to put a kind of cheap but effective "custom sticker" on the food package, so that I can at least be sure that it has not been opened between it leaving the food place and arriving at my door. It might say the restaurant's name and logo with a small text: IF SEAL HAS BEEN BROKEN, DO NOT EAT, AND CONTACT US ASAP! This would cost them virtually nothing extra, yet give me a lot of peace of mind. It also is in line with numerous other such "safety measures" in place today all throughout society, so it wouldn't be an outlandish thing to suggest or do. This would be especially suitable for pizza cartons, but I've never seen that done in any movie or anything, so I'm worried that it might not be done. It really is a major reason why I don't want to order pizza to my home; just the idea of the delivery person opening it and spitting on it (in a way which isn't obvious to the customer) makes me feel uneasy. Is this already done? If so, is it consistently done? Or only by a few major chains?
b998fc29f7745358e986fac90657a0b2fb3cc8c6dcd16dc4b48f8e814c0d5fd2
['b96d24bf41fc479aa8795a19965afa7c']
I am currently in the progress of a database migration from MS Access to SQL Server. To improve performance of a specific query, I am translating from access to T-SQL and executing server-side. The query in question is essentially made up of almost 15 subqueries branching off in to different directions with varying levels of complexity. The top level query is a culmination (final Select) of all of these queries. Without actually going into the specifics of the fields and relationships in my queries, I want to ask a question on a generic example. Take the following: Top Level Query | ___________|___________ | | Query 1 <----------> Query 2 _________________________| Views? |_______________________________ | | | | Query 1.1 Query 1.2 Query 2.1 Query 2.2 ________|______ ______|________ | | | | Query 1.1.1 Query 1.1.2 Query 2.1.1 Query 2.1.2 | | | | ... ... ... ... I am attempting to convert the above MS Access query structure to T-SQL, whilst maximising performance. So far I have converted all of Query1 Into a single query starting from the bottom and working my way up. I have achieved by using CTE's to represent every single subquery and then finally selected from this entire CTE tree to produce Query1. Due to the original design of the query, there is a high level of dependency between the subqueries. Now my question is quite simple actually. With regards to Query2, should I continue to use this same method within the same query window or should I make both Query1 and Query2 seperate entities (Views) and then do a select from each? Or should I just continue adding more CTE's and then get the final Top Level Query result from this one super query? This is an extremely bastardised version of the actual query, I am working with which has a large number of calculated fields and more subquery levels. What do you think is the best approach here?
b818cbaec34fb50d71a3e2a8f3e0280f7ddc351745a5cc7b4af1a1063364bb41
['b96d24bf41fc479aa8795a19965afa7c']
I have managed to resolve this! Thanks for <PERSON> and <PERSON> for the code simplifying but my WHERE clause was not working because I had an incorrect link between the tables. Access creates temporary tables when multiple instances are added to the query pallet. It appends the second instance with _1 which in my case was PART LIBARY HEADER_1 Initially my Joins did not specify this connection: PART LIBARY HEADER ----> PART ASSEMBLY LINK TABLE ----> PART LIBARY HEADER_1 But after re-doing the join's the where clause provided by <PERSON> seemed to do the trick. The exact results are being returned as it is in Access. Thanks for all your help!
6cd69f104902e60f1bb7bc80b413c70689bc32bd301e517c4c52e85300bb14aa
['b97227afdc2746749f77e2597bd74e98']
The issue solved! I have just upgraded Xubuntu 15.10 to Xubuntu 16.04 LTS on my external HDD "in place". Everything worked just fine. The installation process did not mess my MBR/UEFI, the GRUB stayed where it was - on external HDD. So, it is sufficient just to start upgrade process in "normal" way, despite the fact is is all about an external HDD. Cheers folks. DV
640cb2276901678cf906b6e2cb7a81d4aa52593d653c045a059629f9ac421adc
['b97227afdc2746749f77e2597bd74e98']
My parents' house currently has a single 802.11b/g/n/ac access point. It covers about 2/3 of their first floor and 1/3 of their second floor. The rest is lacking signal. They want me to close this gap for them. Also, they have no cell service on their property and would like WiFi in their barn/workshop so that Mom can communicate with Dad easily when he's out there. I have already run ethernet out there to accomplish this. I have three perfectly functional 802.11b/g/n (no ac) access points lying around. Because of this, the cost of using them is $0, which is important here. I'd like to use them, but I'm uncertain about the implications of mixing these with their existing 802.11b/g/n/ac access point. Some of their devices (phones/laptops/tablets) support only 802.11n, so I don't think those devices would notice the difference. But other devices support 802.11ac, and I don't know how they might behave in this environment. Would there be negative implications for those devices to have some access points be 802.11n while one is 802.11ac? Would roaming be adversely affected / impossible?
a26e1b845e2d489c0b08cd6b8272891deef23d5ba538a027448585a2366e2ccd
['b974fff01357405e8cc9888cd638d559']
we are asked to write a function ourselves in Haskell that, when given a list and a certain element returns a new list, containing the ordered positions of that element in that list. I already tried that for a long time now, but the one I currently have still uses recursion, which the task says we are not supposed to use. allPositionsOf <IP_ADDRESS> (Eq a) => a -> [a] -> [Int] allPositionsOf e es = [i | i <- [0 .. (length es - 1)], IsAtPos e es i] where isAtPos <IP_ADDRESS> (Eq a) => a -> [a] -> Int -> Bool isAtPos e (x:xs) 0 |x == e = True |otherwise = False isAtPos e (x:xs) i = findAtPosition xs e (i - 1) I know there is the !! and other functions similar, but is it possible to just use list generators and keep it simpler ?
ff3dddb0b14690cfeff3b2e8667785d2a6ac29d4bf72e7bf0a67b20e5fd72b7b
['b974fff01357405e8cc9888cd638d559']
I want to create more elaborate / complex models from simple ones with lmfit. I have two functions like e.g. a gaussian (norm. to unity at peak) and a lorentzian (norm. to unity at peak) and want to fit e.g. a linear combination of them. Still adding to unity. So I could write a new function like def voigt(*all the parameters*, alpha) return alpha*gaussian(...) + (1-alpha)*lorentzian(...) but this is not very adaptive. So I now do instead: mod = ConstantModel(prefix = 'a1_') + Model(gauss) + ConstantModel(prefix='a2_') * Model(lorentz) pars = Parameters() pars.add('a1_c', value = 1, min = 0, max = 1) pars.add('a2_c', expr = '1-a1_c') Still feels a bit clumsy. Is there a more elegant way?
03a19b4d8ff591cb7e2a0934879f250cafcae5ba7e171df61f924f4e02ff5cd3
['b97763106c954fa388276ac470c446a2']
when I run appium through the terminal with the command "Appium &" it runs appium 1.4.10 When I run it from my GUI (which I need to do to use the inspector) it runs 1.4.8 Any ideas how I can make it run with the latest version from the GUI? Thanks.
48aef51528b979f49842725c92e10eae545e6ca12ac4345937305fcb04f86b16
['b97763106c954fa388276ac470c446a2']
I see Firebase now supports iOS testing in the Test Lab. Is it going to be possible to run iOS UI tests in parallel using Firebase? For instance, if I have 100 iOS UI tests can I run 10 of them on 10 different devices at the same time instead of all 100 on the same device which would take much more time? Thanks, -Matt
463cd1dcaa1a981d57fe1982b28ff7129451bf845320ed1de68750fc3cc87552
['b97e2d0528824e6ba1c985b122217a61']
So i'am trying to show an error message when the user enters an invalid username password combination. My user.service: login(accountCredentials: AccountCredentials): Observable<boolean> { return this.http.post(UrlHelper.routeTo("auth/login"), JSON.stringify(accountCredentials)) .map(n => { this.authService.setToken(n.json().token); this.globalEventsManager.login.emit(); return true; });} My http.service: request(url: string | Request, options?: RequestOptionsArgs): Observable<Response> { let token = this.authService.getEncodedToken(); if (typeof url === 'string') { // meaning we have to add the token to the options, not in url if (!options) { // let's make option object options = {headers: new Headers()}; } options.headers.set('Authorization', `Bearer ${token}`); options.headers.set('Content-Type', 'application/json;charset=UTF-8'); } else { // we have to add the token to the url object url.headers.set('Authorization', `Bearer ${token}`); url.headers.set('Content-Type', 'application/json;charset=UTF-8'); } return super.request(url, options).catch(this.catchAuthError(this));} private catchAuthError(self: HttpService) { // we have to pass HttpService's own instance here as `self` return (res: Response) => { console.log(res); if (res.status === 401 || res.status === 403) { // if not authenticated console.log(res); } return Observable.throw(res); };} My goal is to return from the login method with a "false" value if the authentication went wrong. Thank you in advance!
9b1632854f8e12d8a562a92cb7f5be21ac27cce0393f964c18820106dcef45e3
['b97e2d0528824e6ba1c985b122217a61']
So i have a typescript class (in angular 5) and i am trying to make it working but i have some annoying issues. The class: export abstract class TableComponentBase<TModel extends DomainModel<TModel>, TDialog extends DialogBase<TModel>> extends PageComponent { My method: onCreate() { let dialogRef = this.dialog.open(TDialog, { data: { buttonText: "Létrehozás", title: "<PERSON>", element: new TModel()//FinalExam.createEmpty() } }); The problem is with the "TDialog" which is not acceptable for dialog.open. How could i fix this? And i also trying to figure out how could i initialize a new TModel (like in c# with the new()). Thank you in advance!
9458981ef7e42c33b2844fe049343b9be4c83320561aea4bcb1d771ea4a83239
['b9890149ba3748c1a07888f6dff8fa23']
I have php result set, and from these result i am extracting value using php foreach loop. I put the foreach loop value in array $summery[]. but when i try to print value its print value at once. but i need separate value/result set for each foreach loop as json code so that i can print each result separately. My foreach loop following : foreach($result_UserWrSet as $UserWrInfo) { $summery[]=$UserWrInfo['wr_id']; $summery[]=$UserWrInfo['wr_number']; $summery[]=$UserWrInfo['wr_title']; $dateFlag=1; $result_StartDate = $WrDates ->getDateById($UserWrInfo['date_id'],$dateFlag); $result_EndDate = $WrDates ->getDateById($UserWrInfo['date_id'],$dateFlag); $summery[]=$result_StartDate; $sql_GetUserName = "SELECT user_name FROM user_information where user_id='$UserWrInfo[user_id]'"; $result_GetUserName = mysqli_query($conn, $sql_GetUserName); $num_GetUserName = mysqli_num_rows($result_GetUserName); if ($num_GetUserName > 0){ $UserNameByIdRos = $result_GetUserName->fetch_assoc(); $UserNameById=$UserNameByIdRos['user_name']; } else {$UserNameById=NULL;} $summery[]=$UserNameById; $result_CurrentHop = $WrDates ->getCurrentHopByWrId($UserWrInfo['wr_id']); $result_CurrentHopName = $WrDates ->GetHopsNameById($result_CurrentHop); $summery[]=$result_CurrentHopName; $result_EndDate = $WrDates ->completedDate($UserWrInfo['wr_id']); $summery[]=$result_EndDate; } print json_encode($summery); My result become ["69","010116-69","Wr test","01\/01\/16 18:45 PM","planner","Done","01\/01\/16 19:16 PM","68","010116-","This is title","01\/01\/16 18:44 PM","planner","Done"] but i need : [["69","010116-69","Wr test","01\/01\/16 18:45 PM","planner","Done"],["01\/01\/16 19:16 PM","68","010116-","This is title","01\/01\/16 18:44 PM","planner","Done"]]
b53626887230f034ba23e7ada9bd1ab3525b3ea1506fa8ae8a4901125ac233da
['b9890149ba3748c1a07888f6dff8fa23']
function not calling or working when i include a link, without a include a file, function working properly $AutoRunLink='C:\xampp\htdocs\banking1\index.php'; $sql = "UPDATE automation_schedule SET start_flag='1',done_flag='0',attempt='$AutoAttempt',last_run='$CurrentTime',next_run='$AutoNextRun',run_server_from='$runServer' where ID=$AutoID"; $db->query($sql); require_once '$AutoRunLink'; RestScheduleNextDay($db,$setRunNextDay,$CurrentTime,$AutoID,$runServer);
bc035af358099c81309b9e5429c732c9c64f1740b1435f91661b3c4f69dfb65a
['b993c4a38d294b268ff6c6cf2fb5e717']
Yes this is possible you could navigate the browser from site www.example1.com to www.example2.com/someAction?name=joe for example. However, in order to validate against this you would need some sort of server in which example1 would have to send the data first and store it. This would then allow example2 to call that service checking the data it got via query params was valid. This is a very long winded way to pass data about not sure it is a good solution.
34a1fd4b0cd6328a3b174940b9af35c59f7f7480bae84d7000df1a6a648ee497
['b993c4a38d294b268ff6c6cf2fb5e717']
There are two ways of doing this depending on your independance of the microservices is probably the best answer: Make a internal HTTP call from the ROI -> Institution which would be okay. The problem with this is that if the service is down the data will not be available. Store the data needed to make the calculation inside the ROI service as well. This seems strange but the data once created in say the Institution service it could be sent via a message bus to the ROI service which then uses the data when needed. (this however may not suit your domain, it depends what information it needs). However it seems that the calculation and the storage of the Institutions could be within the same microservice therefore eleminating the problem.
6344eaf0340a49b4f93d23b9dba5bb89549f5107ac04e8aaee30a3983fff1325
['b9999257725a46c9a085f8a11c555e3e']
I am working for a DBMS class and came across 3NF synthesis algorithm here http://cis.csuohio.edu/~matos/notes/cis-611/ClassNotes/13-3NF-Synthesis.html I am stuck with canonical cover computation. The problem is as follows: Reduce the following FD to 3NF: FD1 : AB→C FD2 : C→D FD3 : D→B FD4 : B→E The canonical cover is FD1 : A→C FD2 : C→D FD3 : D→B FD4 : B→E After computing, the relations are merged {(A,C), (C,D), (D,B,E)}. The synthesis algorithm is lossless, but from the method, isn't the FD1 from the question not satisfied?
912f5bb28a6c90f2f95a76efc755ff8217021486c74a442b8e10d7887901f8b3
['b9999257725a46c9a085f8a11c555e3e']
I am working on a file downloader that submits get requests for around thousand files. I came across this article that would aid in submitting a lot of requests using the executor framework. I tried running a smaller number of files (around a hundred), it was working. However, the large number of files that I ran resulted in ConnectionClosedException. This is the download code that submits the requests: void download(String sObjname, List<FileMetadata> blobList) throws IOException, InterruptedException { long totalSize = 0; this.sObjname = sObjname; for (FileMetadata doc : blobList) { totalSize += doc.getSize(); doc.setStatus(JobStatus.INIT_COMPLETE); } totalFileSize = new AtomicLong(totalSize); // Async client definiton; MAX_CONN around 5-15 try (CloseableHttpAsyncClient httpclient = HttpAsyncClients.custom().setMaxConnPerRoute(MAX_CONN) .setMaxConnTotal(MAX_CONN).build()) { httpclient.start(); // Define the callback for handling the response and marking the status FutureCallback<String> futureCallback = new FutureCallback<String>() { @Override public void cancelled() { logger.error("Task cancelled in the rest client."); shutdownLatch.countDown(); } @Override public void completed(String docPath) { FileMetadata doc = futureMap.get(docPath); logger.info(doc.getPath() + " download completed"); totalFileSize.addAndGet(-1 * doc.getSize()); doc.setStatus(JobStatus.WRITE_COMPLETE); shutdownLatch.countDown(); } @Override public void failed(Exception e) { shutdownLatch.countDown(); logger.error("Exception caught under failed for " + sObjname + " " + e.getMessage(), e); Throwable cause = e.getCause(); if (cause != null && cause.getClass().equals(ClientProtocolException.class)) { String message = cause.getMessage(); // TODO Remove this logger.error("Cause message: " + message); String filePath = message.split("Unable to download the file ")[1].split(" ")[0]; futureMap.get(filePath).setStatus(JobStatus.WRITE_FAILED); } } }; // Submit the get requests here String folderPath = SalesforceUtility.getFolderPath(sObjname); new File(new StringBuilder(folderPath).append(File.separator).append(Constants.FILES).toString()).mkdir(); String body = (sObjname.equals(Constants.contentVersion)) ? "/VersionData" : "/body"; shutdownLatch = new CountDownLatch(blobList.size()); for (FileMetadata doc : blobList) { String uri = baseUri + "/sobjects/" + sObjname + "/" + doc.getId() + body; HttpGet httpGet = new HttpGet(uri); httpGet.addHeader(oauthHeader); doc.setStatus(JobStatus.WRITING); // Producer definition HttpAsyncRequestProducer producer = HttpAsyncMethods.create(httpGet); // Consumer definition File docFile = new File(doc.getPath()); HttpAsyncResponseConsumer<String> consumer = new ZeroCopyConsumer<String>(docFile) { @Override protected String process(final HttpResponse response, final File file, final ContentType contentType) throws Exception { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new ClientProtocolException("Unable to download the file " + file.getAbsolutePath() + ". Error code: " + response.getStatusLine().getStatusCode() + "; Error message: " + response.getStatusLine()); } return file.getAbsolutePath(); } }; // Execute the request logger.info("Submitted download for " + doc.getPath()); httpclient.execute(producer, consumer, futureCallback); futureMap.put(doc.getPath(), doc); } if (futureMap.size() > 0) schedExec.scheduleAtFixedRate(timerRunnable, 0, 5, TimeUnit.MINUTES); logger.debug("Waiting for download results for " + sObjname); shutdownLatch.await(); } finally { schedExec.shutdown(); schedExec.awaitTermination(24, TimeUnit.HOURS); logger.debug("Finished downloading files for " + sObjname); } } The stacktrace that I received was: org.apache.http.ConnectionClosedException: Connection closed unexpectedly at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.closed(HttpAsyncRequestExecutor.java:139) [httpcore-nio-4.4.4.jar:4.4.4] at org.apache.http.impl.nio.client.InternalIODispatch.onClosed(InternalIODispatch.java:71) [httpasyncclient-4.1.1.jar:4.1.1] at org.apache.http.impl.nio.client.InternalIODispatch.onClosed(InternalIODispatch.java:39) [httpasyncclient-4.1.1.jar:4.1.1] at org.apache.http.impl.nio.reactor.AbstractIODispatch.disconnected(AbstractIODispatch.java:102) [httpcore-nio-4.4.4.jar:4.4.4] at org.apache.http.impl.nio.reactor.BaseIOReactor.sessionClosed(BaseIOReactor.java:281) [httpcore-nio-4.4.4.jar:4.4.4] at org.apache.http.impl.nio.reactor.AbstractIOReactor.processClosedSessions(AbstractIOReactor.java:442) [httpcore-nio-4.4.4.jar:4.4.4] at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:285) [httpcore-nio-4.4.4.jar:4.4.4] at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) [httpcore-nio-4.4.4.jar:4.4.4] at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590) [httpcore-nio-4.4.4.jar:4.4.4] at java.lang.Thread.run(Unknown Source) [?:1.8.0_72] for a number of workers.
80c7260d0ef292dca7373d0418c38d0f9d322351b85315b01b9b75a5ddbc24aa
['b9a764f1c6734d1f837b24e9837d0667']
I implemented some tabs in my websites, However when I first reload the website, the content of all the tabs is visible, it gets fixed when i select any one tab. Screenshots: Error I'm having Here's my code: HTML <div class="tab"> <div class="tablinks" onclick="openCity(event, 'PaisleyWilkes')"> <img src="image 1.png" alt="" class="avatar"> <div class="details"> <span class="name">Paisley Wilkes</span><br> <span class="designation">UI/UX</span> </div> </div> <div class="tablinks" onclick="openCity(event, 'JohnSmith')"> <img src="image 1.png" alt="" class="avatar"> <div class="details"> <span class="name">John Smith</span><br> <span class="designation">UI/UX</span> </div> </div> <div class="tablinks" onclick="openCity(event, 'JaneSmith')"> <img src="image 1.png" alt="" class="avatar"> <div class="details"> <span class="name">Jane Smith</span><br> <span class="designation">UI/UX</span> </div> </div> </div> <div class="testimonials-content"> <div id="PaisleyWilkes" class="tabcontent"> <h3><PERSON> says</h3> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus amet consequuntur libero hic quod, omnis natus totam vero repellendus aperiam eveniet. Adipisci voluptatibus a recusandae suscipit commodi minus sunt esse!</p> </div> <div id="JohnSmith" class="tabcontent"> <h3><PERSON> says</h3> <p><PERSON> adipisicing elit. Voluptatibus amet consequuntur libero hic quod, omnis natus totam vero repellendus aperiam eveniet. Adipisci voluptatibus a recusandae suscipit commodi minus sunt esse!</p> </div> <div id="JaneSmith" class="tabcontent"> <h3><PERSON> says</h3> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus amet consequuntur libero hic quod, omnis natus totam vero repellendus aperiam eveniet. Adipisci voluptatibus a recusandae suscipit commodi minus sunt esse!</p> </div> JS function openCity(evt, cityName) { // Declare all variables var i, tabcontent, tablinks; // Get all elements with class="tabcontent" and hide them tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } // Get all elements with class="tablinks" and remove the class "active" tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } // Show the current tab, and add an "active" class to the link that opened the tab document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } I would like the first tab to be preselected when the page first loads, how would I go about doing that?
80c263c93b6f87563ea22882c21e445e7cc5a15c08ce01e279caa3b88893fd91
['b9a764f1c6734d1f837b24e9837d0667']
I'm creating a products section for my website, and have been having trouble making it responsive, as media queries refuse to work. Here's my code: HTML <div id="products" class="products"> <h3>Our Products</h3> </div> CSS .products { height: 30vh; width: 80%; margin-top: 15%; margin-left: 10%; } @media only screen and (max-width: 600px) { .products { height: 30vh; width: 80%; background: #333; margin-top: 50%; margin-left: 10%; z-index: 2; } } Even though the margin-top for mobile is supposed to be 50%, it doesn't change when i change the value, any insights into what might be causing the problem.
8a6d80638e0d1f93c541bc60bef0478e618324e496ef3665cbe9ea827785a993
['b9b58139b7904c289fab872314d3fbd0']
I wrote a small app to check AD group members. When I execute the following code on my pc, It works well, the SearchResult contains the "member" property, however when I run the same exe on the server or on an another computer the "member" property is missing. The usnchanged and usncreated will be different also. I run the exe with the same user on every pc. What can cause this? ... using (DirectorySearcher searcher = new DirectorySearcher()) { searcher.CacheResults = false; searcher.Filter = "(&(objectClass=group)(cn=" + ADName + "))"; searcher.SizeLimit = int.MaxValue; searcher.PageSize = int.MaxValue; if (!DirectoryEntry.Exists(ADPath)) { return null; } searcher.SearchRoot = new DirectoryEntry(ADPath); using (SearchResultCollection collection = searcher.FindAll()) { if (collection.Count == 1) { return collection[0]; } } } ...
e42bd4df8a45d0d340f2c0eb2fa60198deba8676df3f231b44d0127b51552530
['b9b58139b7904c289fab872314d3fbd0']
I would like to use a barcode scanner with Windows 10 (Build 15063) via the Windows.Devices.PointOfService namespace. The scanner is a Datalogic Quickscan QD2430 and I tried with all RS-232 and Keyboard mode. I used the official sample application https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BarcodeScanner with no luck. It can detect a device but it's definitely the in-built webcam (HP laptop). I tried to modify the source, the DeviceHelpers's GetFirstDeviceAsync function https://github.com/Microsoft/Windows-universal-samples/blob/master/SharedContent/cs/DeviceHelpers.cs. The DeviceInformation.FindAllAsync also returns only the camera's info as result. string selector = BarcodeScanner.GetDeviceSelector(PosConnectionTypes.All); DeviceInformation.FindAllAsync(selector); It returns nothing. DeviceInformation.FindAllAsync(DeviceClass.ImageScanner); It returns every connected and I think the previously connected but currently offline devices too. I tried to filter the scanner by name. There was a lot filterd result too, but the convertAsync function returned null for all excepts one, it thrown an Exception "A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)". DeviceInformationCollection infos = await DeviceInformation.FindAllAsync(DeviceClass.All); foreach(DeviceInformation info in infos) { if (info.Name.ToUpper().Contains("BARCODE")) { T scanner = await convertAsync(info.Id); if (scanner != null) { return scanner; } } }
a886faed7341ee07403c5b4521861586db7ac3e59ae398852e98a5428d2241d5
['b9bdd97c484544ba90db5572d53248d4']
I'm OP. Appreciate *very much* response; added details in comment to question. Am not saying it would be *easy* to cover all issues, am wondering whether using an existing library (say, passport.js for an Express.js server) is better than rolling my own. I guess my main thought is: security issues will have to be verified anyway; will it much easier with a 3rd-party lib than by rolling my own?
c5b4ee3c293e0dc3dfa5fc2d618277599fee0a5b90cd2332543b7c9b9dd7e2c0
['b9bdd97c484544ba90db5572d53248d4']
You can use train-test- validation split (say 60% train, 20% validation and 20% test.) when you have large dataset. In that case you dont need to use for loop. For smaller dataset normally K-fold is used and in that case for loop can be applied. If you find this answer satisfactory, please don forget to mark right. Thank you
d1be77c26bf10f7dbcd45297cc1bf56a391497a0894274f4373b8b7befc8189d
['b9d505a49ad04c7fb55d53940072580a']
I'm using a MouseMotionListener to draw on a JComponent. addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { System.out.println("DRAG ["+(i++)+"]"); grid.handleMouseEvent(e); } }); When I perform a mouse drag with my trackpad, I get the intended behavior. When I do the same thing with my actual mouse (USB), the drawing 'lags' quite a bit. I noticed that the source of the 'lag' comes from the mouseDragged method not getting invoked when I move my mouse too quickly. Why does this only happen with my mouse and not the trackpad? Here is a (19s) GIF of two launches of the program. The first one shows the laggy drawing with the mouse. The second uses the trackpad and works as intended. I understand that this may end up not being a problem with MouseMotionListener or even Java. If that is the case, I apologize. Maybe I could be redirected to another resource. Thanks!
e95bd3ca7e51044b9b6ba501039eb3c39e521b6491d46cc8e8f2507c6fe8a277
['b9d505a49ad04c7fb55d53940072580a']
I'm writing a query to find all users whose usernames begin with a given prefix. I only want the query to return up to 10 items. My query right now is User.scan('username') .beginsWith(req.query.prefix) .limit(req.query.limit) .exec((err, users) => { ... }); After reading the dynamoose docs for .limit() more carefully, I realized that the limit is on the number of table entries it checks, not the number of entries it returns. So if I have 10 users, 5 of which have usernames that start with 'm', a query like query: { prefix: 'm', limit: 5} could potentially return 0 items. I understand that I could query for all the users in the database, and then only return some of them, but it wouldn't be scalable. How can I query the database so it stops looking through the table exactly when 10 matches have been found?
bd443784e0d6c0962069b7ec10388e03a7353c32521489d41ccd63cd43a99e2e
['b9df71326b2b410092fe9fbfbd5074c9']
I do not know $t_1-t_0$, but I agree, that is the perfect solution if I did. The $\Delta f$ is in the 100s of MHz. TBH I'm not sure if the radar tag belongs here. This isn't a radar problem but I thought It was similar enough that those sorts of solutions might be useful, maybe not. Also, <PERSON>, thanks for fixing my exponent!
75e75c019d9bd446152d47113dd49084e1439133695949b03f43fbd58583fc3d
['b9df71326b2b410092fe9fbfbd5074c9']
Hi. The emails should go to the mail address I provide. Those plugins have a field where I can type the mail address to send the data to. I have tried different mail addresses, but it behaves the same. I can add that there is nothing in the mail server log as well. The script doesn't even try to send emails, because there is nothing in the mail server logs.
ed15c4da872c42b64ab74732b611b3939dbf6a5d3fb716752cf0e64a15ec3a0b
['b9ededa489db4cc49bd9393aa4e9d90d']
So, there's a few ways you can do that, if you're not constricted to using a UL for those, I would reccomend just using divs and assigning them to a width and floating them right.... example here: <div style="float:left; width: 200px;"><strong><PERSON>> <div style="float:left; width: 200px;"><strong>Owner / Web Master</strong></div> It will then just keep everything at a certain width no matter what you put in each div.
99e1b37e75934f1b5ec5ec64a1f97f48182f3cbf8ec1ac07e24375e528066f44
['b9ededa489db4cc49bd9393aa4e9d90d']
I'm really struggling with this so I was hoping someone could help me. I'm using woocommerce plugin, the products for the breadcrumbs only show the main category of a certain product, I would like it so that it could show the sub categories as well. For example, I would like it to be Bottoms > Leggings > Skirts. The woocoommerce breadcrumb code I have now only shows Bottoms: <?php woocommerce_breadcrumb(); ?> Is there anyone who might know how I can add this so that it shows the trail of sub categories in woo commerce category pages? Thanks
3a0e5c5e758e324b68d9551a7a8abfbef5eb4da2c7153d00255a424465194fd9
['b9ef15019ae547e094a87c0f9ef1a4c2']
The Facebook question was "What's the chance one of my Facebook friends was born in May?" My answer: Months that are not May = 11. The month that is May = 1, the number of Facebook friends I have = 350. Therefore, P(A) where A=none of my Facebook friends was born in May, P(A)=(11/1)^350. I say that is a probability of 9.15537170E+150/1 So, very likely one of them was born in May. Am I wrong?
9493ff942af73c83acf2711dbd56c8c366ae8ad4dacd0e451098af528493691c
['b9ef15019ae547e094a87c0f9ef1a4c2']
Guys, I know a similar question exists but the thread seems to be inactive, and I really would like this question to be answered. It's been annoying me for a few days now. I'm wondering how to remove the divider line between the Master and Detail view in the UISplitViewController. I know its possible to remove/hide/cover it up because I see some apps in the store without that line. I have tried setting backgroundColor to clearColour on my views but to no avail. So SO community, you're my only hope!
b84a2dfac1987ee3b640499ae0ae5d7a7ae966b1cbc5e67b683315fabd35fec9
['ba0dd156371e45c983d5378f7d5d0110']
I got the same problem. In Play 2.6.x you need to inject BodyParser and extend ActionBuilder. You can also try it this way class SecuredActionBuilder(val parser: BodyParser[AnyContent])(implicit val executionContext: ExecutionContext) extends ActionBuilder[SecuredRequest, AnyContent] { def invokeBlock[A](request: Request[A], block: (AuthenticatedRequest[A]) => Future[Result]): Future[Result] = { request.jwtSession.claimData.asOpt[JWTToken] match { ... } }
ffaa77e3d13b3bcce1c0656e80c0e261853beedb156d9af2e48e91d4330e2341
['ba0dd156371e45c983d5378f7d5d0110']
You can create a generic class writing test cases for all repositories like this: class TestModel[T: ClassTag] extends WithApplicationLoader { lazy val app2dao = Application.instanceCache[T] lazy val repository: T = app2dao(app) def result[R](response: Future[R]): R = Await.result(response, 2.seconds) } And, Now pass your Test Class in TestModel to create an object from your test case like this: class TestRepositoryTest extends Specification { private val modelTest = new ModelsTest[TestRepository] "Test Repository" should { "store a user" in { val testObj = Test(0, "<EMAIL_ADDRESS>", new DateTime(System.currentTimeMillis)) val storeResult = modelTest.result(modelTest.repository.store(testObj)) storeResult must equalTo(1) } } }
a5bf659bd73ca3b78fc9b70a7fe12fb75f805e36303a223b0a9eee519e8eec4d
['ba128c3245f0413db1d85adbc8f307b6']
I'm trying to determine how many times a word occurs within a table for a uni assignment. I've been using sys.dm_fts_index_keywords_by_document in SQL Server 2012 as I've used it previously in 2008. It worked fine before, but in this context SQL Server doesn't seem to like it very much. SELECT display_term, SUM(occurrence_count) AS APP FROM sys.dm_fts_index_keywords_by_document ( DB_ID('Assign2A_341'), OBJECT_ID('Post') ) GROUP BY display_term ORDER BY APP DESC I keep running into this error: Msg 30004, Level 16, State 1, Line 1 A fulltext system view or stvf cannot open user table object id 599673184. This is the format of the table being used: CREATE TABLE Post( Post_ID FLOAT NOT NULL, Post_Txt NVARCHAR(MAX) NOT NULL, Post_Date NVARCHAR(255) NOT NULL, Post_Author VARCHAR(50) NOT NULL, PRIMARY KEY(Post_ID)); I can't see any reason why this shouldn't work, the context in which I previously used it was very similar to how I'm using it now, the only difference being the version of SQL Server I'm using and the content of the table. Any help would be very appreciated!
508d04be8a1d1781ae8784101d269fc91f01a5f5e59eff24dd58135404f14c4a
['ba128c3245f0413db1d85adbc8f307b6']
I've been trying to insert data from one row in a temporary table into an existing table in my database, which I've managed to do, but I also want to increment the ID column that already exists in the Topic table. The temp table has two columns, ID and keyword, but the keyword I'm getting from the temp table is always the first row, so the ID will always be 1 in the temp table, whereas I want the ID to be the count of the topic table plus 1. Sorry if this has been asked before, I just had no idea what to search for! This is what I have so far, not sure if I'm on the right track or not: --declare topic id and set it as one more than the current number of rows DECLARE @T_ID int SET @T_ID = (SELECT COUNT(*) FROM Topic)+1 --insert keyword into Topic table INSERT INTO Topic(Topic_ID, Topic_Name) SELECT keyword FROM #tempKeywords WHERE ID = 1
d9abfb61e99cc96e37678cdced543f91e759510b91eb57f5c4fca6046a9c8dfd
['ba1a6f14cfee48d78760fcf658294f3a']
We have an Openshift project ( project1 ) in which we setup an AMQ Artemis broker using the image : amq- amq-broker-7-tech-preview/amq-broker-71-openshif . Being the basic image we don't have any configuration such as SSL or TLS. In order to do the setup we used as example : https://github.com/jboss-container-images/jboss-amq-7-broker-openshift-image/blob/amq71-dev/templates/amq-broker-71-basic.yaml After the deployment of the image on Openshift we have the following: broker-amq-amqp (5672/TCP 5672) No route broker-amq-jolokia (8161/TCP 8161) No Route broker-amq-mqtt ( 1883/TCP 1883 ) No route broker-amq-stomp ( 61613/TCP 61613 ) No route broker-amq-tcp ( 61616/TCP 61616 ) No route My question is : how we can check if the broker is healthy using the TCP connection to broker-amq-jolokia ? So far we connected using TCP Sockets in Java to broker-amq-jolokia but we don't know what message in order for Jolokia to respond with the health status of the broker
70928c93b191e5ebb27194928b3086ab5fed75bf2554b0544b443151d6b88199
['ba1a6f14cfee48d78760fcf658294f3a']
I'm relatively new to these 2 frameworks that I have to use for a school project and I have a little curiosity. So far I have the CRUD Operations to add a new employee that has multiple attributes, to update an employee and delete him but I am not using a DB like Postgres, Oracle etc.So I am wondering where the actual data is stored because so far like I said I only have a class that saves the information in a HashMap but after the closing the application how come that the data is saved and where. Sorry for the newbie question
bc35503390bdd33679e4e53d694b8db5820b942be7ac80e967f1b617ece17075
['ba1b39d928354b05a8eeb864680d11e0']
What I can use except button in online Excel? It's not allowed: We can't show these features in the browser: • Objects like form toolbar controls, toolbox controls, and ActiveX controls But you can see all the content in this workbook by opening the file in Excel. I just wanted to give end user solution for hidding/showing many group of columns. Private Sub ToggleButton1_Click() Dim xAddress As String xAddress = "L:P" If ToggleButton1.Value Then Application.ActiveSheet.Columns(xAddress).Hidden = True Else Application.ActiveSheet.Columns(xAddress).Hidden = False End If End Sub
b83669058c08772e64b1d71cbe341d0d1f34322fe52abf6ec65f901bdcd7d913
['ba1b39d928354b05a8eeb864680d11e0']
I have simple Excel macro, for ToggleButton: Private Sub ToggleButton1_Click() Dim xAddress As String xAddress = "L:R" If ToggleButton1.Value Then Application.ActiveSheet.Columns(xAddress).Hidden = True Else Application.ActiveSheet.Columns(xAddress).Hidden = False End If End Sub When I upload this to OneDrive and download, macro disappear. I have just ToggleButton definition, so it doesn't work. How I can store this macro permanently?
8c4bd80acc4baa9f1e56bc3d59ec778b7040a92001e8f5c573fd3fa96deb5443
['ba1d60ae611d4a13a167627e05944874']
I got a solution. If you don't want csrf_token for a selected URL. Then got to app => Http => Middleware and fine VerifyCsrfToken.php file. In this file there is one variable that is $except that holds those URL in which you don't require a csrf token. So add your URL like this. protected $except = [ 'payment/*', ];
765691e247cdb1f6d6c7b8e9bc7de22517979b49f1cc4e05f9412eed1f4930b7
['ba1d60ae611d4a13a167627e05944874']
Modify your code try it. <!DOCTYPE html> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.0.min.js"></script> <script> $(document).ready(function(){ $("#signupformsubmit").on("click",function(e){ e.preventDefault(); verifysubmit(); }); $(".errorField").on("blur",function(e){ verifysubmit(); }) var validemail = false ; var validpassword = false ; var validusername = false ; var validage = false ; function verifyemail() { var email = document.getElementById("signupemail").value ; var error = document.getElementById("signupemailerrors") ; var emailregex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ ; if(email.length < 254){ if( email.length > 0 ){ if(email.match(emailregex)){ error.innerHTML = ""; console.log("preg"); return validemail = true ; } else { error.innerHTML = "Invalid email address."; return validemail = false ; } }else { error.innerHTML = "Please fill in." ; return validemail = false ; } } else { error.innerHTML = "Maximum length exceeded."; return validemail= false ; } } function verifypassword(){ var password = document.getElementById("signuppassword").value; var passworderror= document.getElementById("signuppassworderrors") ; if (password.length < 254){ if(password.length > 7){ passworderror.innerHTML = ""; return validpassword = true ; } else if(password.length == 0) { passworderror.innerHTML = "Please fill in."; return validpassword = false ; } else { passworderror.innerHTML = "At least 8 characters required."; return validpassword = false ; } } else { passworderror.innerHTML = "Maximum length exceeded."; return validpassword = false ; } } function verifyusername(){ var username = document.getElementById("signupusername").value ; var usernamerror = document.getElementById("signupusernameerrors") ; if (username.length == 0) { usernamerror.innerHTML = "Please fill in."; validusername = false; } else if (username.length > 50) { usernamerror.innerHTML = "Maximum length exceeded."; validusername = false; } else { usernamerror.innerHTML = ""; validusername = true; } } function verifyage(){ var age = document.getElementById("signupage").value ; var ageerror = document.getElementById("signupageerrors") ; var ageregex = /^\d+$/; if(age.length == 0){ ageerror.innerHTML = "Please fill this field"; validage = false; } else { if (age.match(ageregex)){ if (age == 0){ ageerror.innerHTML = "Please provide your real age." ; validage = false; } else if(age > 130){ ageerror.innerHTML = "Please provide your real age." ; validage = false; } else { ageerror.innerHTML = "" ; validage = true; } }else { ageerror.innerHTML = "Only numbers allowed." validage = false; } } } function verifysubmit(){ console.log("test"); //verifyage(); var email = verifyemail(); var pass = verifypassword(); console.log(email+pass); // verifyusername(); if (email == 1 && pass == 1) { console.log("true"); document.getElementById("signupformsubmit").disabled = false ; } else{ document.getElementById("signupformsubmit").disabled = true ; } } }); </script> <input type="text" id="signupemail" class="errorField"> <input type="password" id="signuppassword" class="errorField"> <input type="button" id="signupformsubmit" value="Submit" > <div id="signupemailerrors"></div> <div id="signuppassworderrors"></div> </html>
2f1245e7f8f98089e27fbac8bf66fb1166789eb97c9abf9f9563baa446b7f4bf
['ba2e9841e7ca43fa9ae682dd5c64bf10']
The exception says: Unhandled exception at 0x00F52157 in Foundry.exe: 0xC0000005: access violation reading location 0x00000030. and points to this line in controls.cpp: glfwGetCursorPos(window, &xpos, &ypos); Controls code in separate file controls.cpp: #include "stdafx.h" #include <GLFW/glfw3.h> extern GLFWwindow* window; #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> using namespace glm; #include "controls.hpp" glm<IP_ADDRESS>mat4 ViewMatrix; glm<IP_ADDRESS>mat4 ProjectionMatrix; glm<IP_ADDRESS>mat4 getViewMatrix(){ return ViewMatrix; } glm<IP_ADDRESS>mat4 getProjectionMatrix(){ return ProjectionMatrix; } glm<IP_ADDRESS>vec3 position = glm<IP_ADDRESS>vec3( 0, 0, 5 ); float horizontalAngle = 3.14f; float verticalAngle = 0.0f; float initialFoV = 45.0f; float speed = 3.0f; float mouseSpeed = 0.005f; void computeMatricesFromInputs(){ static double lastTime = glfwGetTime(); double currentTime = glfwGetTime(); float deltaTime = float(currentTime - lastTime); double xpos; double ypos; glfwGetCursorPos(window, &xpos, &ypos); glfwSetCursorPos(window, 1280/2, 1024/2); horizontalAngle += mouseSpeed * float (1280/2 - xpos ); verticalAngle += mouseSpeed * float (1024/2 - ypos ); glm<IP_ADDRESS>vec3 direction( cos(verticalAngle) * sin(horizontalAngle), sin(verticalAngle), cos(verticalAngle) * cos(horizontalAngle) ); glm<IP_ADDRESS>vec3 right = glm<IP_ADDRESS>vec3( sin(horizontalAngle - 3.14f/2.0f), 0, cos(horizontalAngle - 3.14f/2.0f) ); glm<IP_ADDRESS>vec3 up = glm<IP_ADDRESS>cross( right, direction ); if (glfwGetKey( window, GLFW_KEY_UP || GLFW_KEY_W ) == GLFW_PRESS){ position += direction * deltaTime * speed; } if (glfwGetKey( window, GLFW_KEY_DOWN || GLFW_KEY_S ) == GLFW_PRESS){ position -= direction * deltaTime * speed; } if (glfwGetKey( window, GLFW_KEY_RIGHT || GLFW_KEY_D ) == GLFW_PRESS){ position += right * deltaTime * speed; } if (glfwGetKey( window, GLFW_KEY_LEFT || GLFW_KEY_A ) == GLFW_PRESS){ position -= right * deltaTime * speed; } float FoV = initialFoV; ProjectionMatrix = glm<IP_ADDRESS>perspective(FoV, 5.0f / 4.0f, 0.1f, 100.0f); ViewMatrix = glm<IP_ADDRESS>lookAt(position,position+direction,up); lastTime = currentTime; } The program works well without matrices being modified by input controls. To be honest, I don't know much about low level programming and memory allocation, so this might be the cause.
945820acf7a58b54a1f45f9045924fb66f1bf6d6f05218fd999a7a343641f1ef
['ba2e9841e7ca43fa9ae682dd5c64bf10']
Error error C2668: 'sqrt' : ambiguous call to overloaded function c:\program files\assimp\include\assimp\vector3.inl occures when I include 'scene.h' in main cpp file: #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <GL/glew.h> #include <GLFW/glfw3.h> GLFWwindow* window; #include <glm/glm.hpp> #include <glm/gtx/transform.hpp> #include <glm/gtc/matrix_transform.hpp> #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #define MESH_FILE "cube.obj" using namespace glm; #include "common/shader.hpp" #include "common/controls.hpp" I can't get what does it conflict with?
9917b11b7c174696afc54d97be0674881814fee109da5f691d6cb09738ca34da
['ba310d23675a462c9b29de55bd925a89']
I an using PHP to query Google cloud datastore records. This is my PHP code: $datastore = new DatastoreClient(['projectId' => $projectId, 'namespaceId' => 'ssd']); function getList(DatastoreClient $datastore){ $cursor=null; $query = $datastore->query() ->kind('keypad_research') ->start($cursor); $results = $datastore->runQuery($query); $entries = []; foreach ($results as $entity) { $entry = $entity->get(); $entry['id'] = $entity->key()->pathEndIdentifier(); $entries[] = $entry; } return [ 'entries' => $entries, ]; } The result returned look like this: Array ( [entries] => Array ( [0] => Array ( [phone6] => <PHONE_NUMBER> [gender] => Male [phone2] => <PHONE_NUMBER> [concept3] => 2.84 [concept6] => 0 [race] => White [phone4] => <PHONE_NUMBER> [age] => 26-35 [concept2] => 2.06 [concept5] => 3.56 [phone3] => <PHONE_NUMBER> [phone1] => <PHONE_NUMBER> [concept1] => 2.53 [phone5] => <PHONE_NUMBER> [concept4] => 12.8100 [id] => 4795887050031104 ) [1] => Array ( [phone3] => <PHONE_NUMBER> [phone1] => <PHONE_NUMBER> [concept1] => 4.16 [phone5] => <PHONE_NUMBER> [concept4] => 2.7300 [phone6] => 0 [gender] => Male [phone2] => <PHONE_NUMBER> [concept3] => 2.71 [concept6] => 0 [race] => Black [phone4] => <PHONE_NUMBER> [age] => 46-65 [concept2] => 3.6 [concept5] => 3.36 [id] => 4796717991985152 ) [2] => Array ( [race] => White [phone4] => -442751970 [age] => 18-25 [concept2] => 54.84 [concept5] => 3.17 [phone3] => -442751970 [phone1] => -442751970 [concept1] => 2.62 [phone5] => -442751970 [concept4] => 2.3700 [phone6] => -442751970 [gender] => Male [phone2] => -442751970 [concept3] => 3.29 [concept6] => 2.58 [id] => 4804278879256576 ) ) ) As you can see, the array items are not ordered in the same way, each array is ordered differently. I was wondering if I should write the code differently so that every array returned has same order of items? I would like every array item to be like this: [2] => Array ( [id] => 4804278879256576 [phone1] => -442751970 [concept1] => 2.62 [phone2] => -442751970 [concept2] => 54.84 [phone3] => -442751970 [concept3] => 3.29 [phone4] => -442751970 [concept4] => 2.3700 [phone5] => -442751970 [concept5] => 3.17 [phone6] => -442751970 [concept6] => 2.58 [race] => White [age] => 18-25 [gender] => Male ) Thanks
e758cb82f559c41d1bdfb0a6adb1da8654d816c8cfb87f83baf12188fef4822f
['ba310d23675a462c9b29de55bd925a89']
I am looking for a javascript function which will take one date value and tell me the next 30 days values. For example, if the current date is 5 August 2011 I would want it to list all 30 days after this: 5 August 2011 6 August 2011 ..... 3 Sep 2011 The function basically takes care of the month days (30 or 31 or 28 etc.) Is this something I can solve easily? Thanks a lot for your help.
c619228b5493ab2d31ab0e699d5adef1f4374409020c57ea3317f2eaaf754966
['ba40930958664cff93a7c3a12123d8dc']
So the question is to find the longest substring in abc order given a string, s, so this piece of code works in some cases but so this s that I defined it does work and I have no clue as to why s = 'vwjxxumjb' longest = s[0] current = s[0] for c in s[1:]: if c >= current[-1]: current += c if len(current) > len(longest): longest = current else: current = c print ("Longest substring in alphabetical order is:", longest)
6a6fd7d4d67e31aaae8a2f55192144e8fa3f359f13745d88da0eecf966a593d2
['ba40930958664cff93a7c3a12123d8dc']
So I have to make a function called frac-sum the takes the sum of a fraction of two functions from -n to n so f(n)/g(n) as the fraction and the sum from -n to n so f(-n)/g(-n) + ... f(n)/g(n) It takes three formal parameters f g and n. So far I have this which should work but ends up going in a recursive loop meaning there is something wrong with my base case: (define (negn n) (- (* n -1) 1)) (negn 1) (define (frac-sum f g n) (cond ((= n (negn n)) 0) ((= (g n) 0) (+ 0 (frac-sum f g (- n 1)))) ((+ (/ (f n) (g n)) (frac-sum f g (- n 1)))))) And I used this to test it which should output two: (frac-sum (lambda (x) (- x 1)) (lambda(x) x) 1)
ec50da73caab2b0ecae9b6454cf7897997cc013acb8c8f36e80bf33272b53345
['ba55c49b0b69457093ed5676ad09a4b6']
The installation option selected is "ubuntu inside windows", which also means "alongside windows" (or so I presume - this option is for dual boot). Once this option is selected, rest of the installtion is from within windows and not the way mentioned in installation guidelines. Then installation (from windows - running pyrun.exe) aborts due to the above error
2f7d88c771517b7cbb5bcbcc64e96aa837aa09cea32485337b064413c5589ac2
['ba55c49b0b69457093ed5676ad09a4b6']
I'm trying to implement a program using C++ that could determine a B-spline curve which would represent rational motion between given control positions (following along with <PERSON> and <PERSON>'s Spatial Rational B-Spline Motion paper, here). In the paper the authors define the motion curve as being based on three parameters, $v_0(t)$, $v_{0...3}(t)$ and $d_{0...3}(t)$. But where do these parameters come from? Are they simply defined by the transformation from one control point to another, just parameterized with time? I'm really stuck on this, and am having difficulty proceeding forward. Any help would be greatly appreciated!
b85137eb2bbabfd7733284bf5052440070dd5678e152515f938b9048a0edf8ea
['ba69907445d9454d9edc85ac14a3d056']
Journalling is a property of a file system that basically lets it keep track of what has been done. In a case of a crash, it's easier to restore. Notice, that there is no option for non-journaled HFS+. I'd recon there are problems with BootCamp on the Windows side, when using APFS. APFS uses a more modern approach (keyword "copy on write") instead of journaling.
916411625043c29c46803531d3322dc3fe2eb873f6378d09b82ee28e46ca29c9
['ba69907445d9454d9edc85ac14a3d056']
The word I'm looking for describes a piece of literature/media well-known among members of a certain profession/practice as the bible of their trade. For example, A Twist of the Wrist by <PERSON> is well-known among motorcycle riders as the go-to resource for a beginner learning to ride a motorcycle.
90ff3839685752b8b68143cded69c7e08936590a34e2aa8a5c3088cfe2ce2eec
['ba739513811340d2b2a00827cb1b87d0']
By using the dereferencing operator *, you are basically treating the data that the pointers point to as regular variables. Structs are copied by value, not by reference, if you aren't copying the pointer, so it's just like copying an int to another int. You are essentially doing the following by using the dereference operator *: struct myTestStruct destStruct, srcStruct; srcStruct.variable1 = 11; destStruct = srcStruct; //this gets copied by value
afa2b22cac0a7a8c1f8e9e8aab113dd358ceb4592a9761a57190ea3a9e1fc527
['ba739513811340d2b2a00827cb1b87d0']
I am attempting to use a TensorArray in a while_loop, where each iteration of the loop fills one item in the TensorArray. A minimal example below is shown: ta = tensor_array_ops.TensorArray(size=4, tensor_array_name='output_ta', dtype=tf.float32) time = tf.constant(0) def _call(time, ta): ta.write(time, tf.constant([1.,2.,3.,4.])) return (time+1, ta) _, t_out = tf.while_loop( cond=lambda time, _: time < 4, body=_call, loop_vars=(time, ta) ) Now, this code runs fine. However, as soon as I try to do anything with t_out, it gives an error e.g. t_out.stack() >>> Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor. Can anyone see what is wrong with my code? Edit: This only seems to happen in Eager mode. If anyone knows how I can fix it so it works in eager mode that would be great.
3015e17b1c07cfe8f0c1d3171c1999849c1a8777e4eba2101d7ce20bf5d8bb80
['ba7a9f0379754067a76d0e9560e79bb9']
У меня почему то не получается, что может быть не так? Могу показать полностью весь код, у меня также прописан css и js, на всплывающее окно при нажатии кнопки. Вот это окошко дополнительное(строки тариф, контактное лицо...) что под таблицей находится в сыром виде, оно скрыто и появляется при нажатии. Может на это влиять что у меня не получается?
21b1d23e97376ac951915c2df471e664c2b955e9b4b0e2fc6f5857935943f3c5
['ba7a9f0379754067a76d0e9560e79bb9']
Здравствуйте. Здесь при нажатии кнопку заказать выходит дополнительное окошко. Какой можно употребить скрипт получения и передачи значения, только скрипт. Что-б в зависимости от того, куда нажал в поле ввода тариф, уже было введено слово. Например нажал на демо, вышло окошко и в поле уже введено демо, нажал на стандарт уже введено стандарт.Код с таблицей и дополнительным окошком пишу ниже: <table border="1"> <tr class="tablic"> <td>Формат</td> <td>Демо<br/>0 P<br/> <button type="button" class="knopka_demo" data-modal="modal_1">Заказать</button> </td> <td>Стандарт<br/>3000 P<br/> <button type="button" class="knopka_standart" data-modal="modal_2">Заказать</button> </td> <td>Оптимальный<br/>5000 P<br/> <button type="button" class="knopka_Optimal" data-modal="modal_3">Заказать</button> </td> <td>Максимальный<br/>8000 P<br/> <button type="button" class="knopka_maksimal" data-modal="modal_4">Заказать</button> </td> <td>Максимальный плюс<br/>8000 P+<br/> <button type="button" class="knopka_maksimal_plus" data-modal="modal_5">Заказать</button> </td> </tr> </table> <div class="overlay" data-close=""></div> <div id="modal_1" class="dlg-modal"> <span class="closer" data-close=""></span> <table> <tbody> <tr> <th class="lable">Тариф</th> <td class="input"><input type="text" class="mytext" value="Демо"></td> </tr> <tr> <th class="lable">Контактное лицо</th> <td class="input"><input name="name" size="40" maxlength="40" class="input" type="text"></td> </tr> <tr> <th class="lable">Название организации</th> <td class="input"><input name="name" size="40" maxlength="40" class="input" type="text"></td> </tr> <tr> <th class="lable">ИНН организации</th> <td class="input"><input name="name" size="40" maxlength="40" class="input" type="text"></td> </tr> <tr> <th class="lable">Email</th> <td class="input"><input name="email" size="40" maxlength="40" class="input" type="text"></td> </tr> <tr> <th class="lable">Телефон</th> <td class="input"><input name="phone" size="40" maxlength="40" class="input" type="text"></td> </tr> <tr> <th></th> <td align="center"> <input name="order_submit" type="submit" value="Заказать"> </td> </tr> </tbody> </table> </div> </div>
ad59cc7aaddefe2d457f64da5c620a2be2e88acd7974add41e2b8736ba336d01
['baa831185fdf4efbbf833fe4895857ed']
How can I overwrite an array, which is marked as modified, in a method? Or is there a way in Dafny just increase the length of an array by one? class ownerIndexs{ var oi : map<int, int>; constructor(){ new; } } class Pendingstate{ var yetNeeded : int; var ownersDone : bv256; var index : int; } class mo{ var m_pendingIndex : array<int>; var m_ownerIndex : ownerIndexs; var m_pending : map<int, Pendingstate>; var m_required : int; method confirmAndCheck(operation : int, msgsender : int) returns (boo : bool, ownerIndex :int,pending : Pendingstate) requires m_pendingIndex != null modifies this.m_pendingIndex ensures m_pendingIndex != null && pending != null ==> 0 < pending.index < m_pendingIndex.Length && m_pendingIndex[pending.index] == operation { pending := new Pendingstate; pending.index := m_pendingIndex.Length; this.m_pendingIndex := extendArrayByOne(this.m_pendingIndex); //Problem with modify clause m_pendingIndex[pending.index] := operation; } method extendArrayByOne(oldarray:array<int>) returns (newarray:array<int>) requires oldarray!=null ensures newarray != null ensures fresh(newarray) ensures newarray.Length == oldarray.Length+1 ensures forall k<IP_ADDRESS> <= k <oldarray.Length ==> oldarray[k] == newarray[k] modifies oldarray { newarray := new int[oldarray.Length+1]; var i:=0; while (i < oldarray.Length) invariant newarray.Length == oldarray.Length+1 invariant i<=oldarray.Length invariant forall k<IP_ADDRESS> <= k < i ==> oldarray[k] == newarray[k] { newarray[i] := oldarray[i]; i := i + 1; } } } As you can see in this code. I am trying to increase the length of an array by one in the method extendArrayByOne. After that I am adding the element operation at the end of the new array, which was returned from extendArrayByOne, in the method confirmAndCheck. Here is a link to a official compiler, which can compile this code: https://rise4fun.com/Dafny/WtjA And here is the link to my previous question about extendArrayByOne: Modifies clause error on a changed object
11b4ad676aa93c09d02d4adb9626dc69d5a866ab03ebbec9cb3ff81df920a210
['baa831185fdf4efbbf833fe4895857ed']
I dont know exactly where ur problem is, but did u try switch statement? It keeps your code simple, for example: switch(1) { case 1 : cout << '1'; // prints "1" break; // and exits the switch case 2 : cout << '2'; // without break it will show 2 and after it 3 until next break case 3: cout << '3'; }
97b821a2747e318850a0039941951600549777717eaa064c78fc9f620638d36a
['baa929cf3a5243f0a6b7d22c849694a8']
I have a loop I'm using which works great that is: for i, line in enumerate(lines2): if "2. Primary Contact Person" in line: print(*lines[i:i+5], sep="\n") Which gives me back contact information. So far no issues. But I now want to make the print out and append it into a new list instead of just printing it. I tried primary_contact = [] for i, line in enumerate(lines2): if "2. Primary Contact Person" in line: primary_contact.append(*lines[i:i+5], sep="\n") But i get the following error: TypeError: append() takes no keyword arguments How would I get this to output to be added into a list?
05919f19d021e3cc69193a34b04bb7409057d665abbb1dcc4048da1ef6cffe26
['baa929cf3a5243f0a6b7d22c849694a8']
I have a LinkedList that I have created when used creates a Band, Song, and Duration of the song list. Example output: Band: Led Zepplen | Song: Stairway to Heaven | Duration: 8.02 minutes Band: AC/DC | Song: Back in Black | Duration: 4.14 minutes Band: The Rolling Stones | Song: Paint it Black | Duration: 3.46 minutes What I can't figure out is how to implement a method where I can insert a node in any given position. So far my code looks like this: public class <PERSON> { private String band; private String name; private double duration; <PERSON> next; public Song(String band, String name, double duration) { this.band = band; this.name = name; this.duration = duration; } public String getBand() { return band; } public void setBand(String band) { this.band = band; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getDuration() { return duration; } public void setDuration(double duration) { this.duration = duration; } public Song getNext() { return next; } public void setNext(Song next) { this.next = next; } public Song getLastNode() { Song currentNode = this; while(currentNode.next != null) { currentNode = currentNode.next; }; return currentNode; } public void append(Song newSong) { Song tmpNode = this.getLastNode(); tmpNode.next = newSong; } public void printAllSongs() { // print all songs from j Song currentNode = this; do { System.out.println("Band: " + currentNode.getBand() + " | " + " Song: " + currentNode.getName() + " | " + " Duration: " + currentNode.getDuration() + " minutes"); currentNode = currentNode.next; } while( currentNode != null ); } } public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Song mySong = new Song("Led Zepplen", "Stairway to Heaven", 8.02); mySong.append(new Song ("AC/DC", "Back in Black", 4.14 )); mySong.append(new Song("The Rolling Stones", "Paint it Black", 3.46)); mySong.printAllSongs(); } } What is one way I could achieve coding a method that inserts a node at any given position?
b07e6192fdf229698922b3cfadffc78161dc7fd9ac36a83a701cb78267d6cbce
['babfb2d972994d85abd325aede30de0b']
assets:precompile comsume a lot of memory when you run it; try check you system monitor when you running it and increase you memory in the server where you execute that task. By the way config.serve_static_assets = false should be false in production the server software (e.g. NGINX or Apache) used to run the application should serve static assets instead. Also now this property was rename to config.serve_static_files, as I remember.
d2c024df16a78f498040a3d6c4f8242a4dc220beb545776abf9ad779b3c824d3
['babfb2d972994d85abd325aede30de0b']
You need to process the event object in the function. $("#div123").click(function(e){ e.pageX; e.pageY; }); event.pageX The mouse position relative to the left edge of the document. event.pageY The mouse position relative to the top edge of the document. check the doc: https://api.jquery.com/category/events/event-object/
928f59525715ba4c1b8b3f76d285ffe613bb58431a82e221af7a63f7c5d7a906
['bacea032ca7f4a9baacb4098886d3dcf']
I create a node module file in my project ressources/js/fc.js function test(nbp, varElt){ if(nbp > 1) varElt.innerText = nbp.toString(); else varElt.innerText = nbp.toString(); } module.exports = { test } In my ressources/layouts/app.blade.php I add my module like that : <script src="{{ asset('js/fc.js') }}" type="module"></script> but when in a page section view I want to import my module i have an error ressources/views/tests/test.blade.php @extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="card"> <div class="card-body" style="min-width: 700px;text-align: center"> <h2 id="test1"></h2><br> </div> </div> </div> </div> @endsection @section('script') <script> import { test } from "../../../public/js/impFc"; $(function(){ const title = document.getElementById("test1") ; test.test(1,title) }) </script> @endsection My error : Uncaught SyntaxError: Cannot use import statement outside a module SOmeone have any idea to resolve this ?
47c9ea853cd56c7777c0e15b9fb3eeb6477c8f15c9b3249f2e6b5f1e572608f6
['bacea032ca7f4a9baacb4098886d3dcf']
I create a Windows service and a setup project. Actually, the connection string of my DbContext is in my project .config but the user can see the content of the .config and modify it so where can store my connection string ? IMPORTANT : I get the from the user interface during the installation of my project.
12d9eb5fc8337b9aab4972281315aaffedc7ecada90254f022576a78339d278c
['bad0f2cf80cc4a9c83cb68428a930581']
As the title says I wish to know how come that in MyApp() or Firstpage() I have to make a builder so that I my Mediaquery.of(context) may works Although, to other pages it works fine. My question is since my other pages works without builder should I still add it? Here is the code MyApp() code import 'package:flutter/material.dart'; import 'package:fluttertestpage/FirstpageUI.dart'; import 'package:fluttertestpage/secondpage.dart'; void main() { runApp(FirstPage()); } class FirstPage extends StatefulWidget { @override _FirstPageState createState() => _FirstPageState(); } class _FirstPageState extends State<FirstPage> { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold(body: FirstPageUI().getFirstPageUIWidget())); } } Connected returning widget import 'package:flutter/material.dart'; import 'package:fluttertestpage/secondpage.dart'; class FirstPageUI { Widget getFirstPageUIWidget() { return Builder( builder: (context) => (Container( width: MediaQuery.of(context).size.width*.5, color: Colors.black, child: Center( child: RaisedButton( child: Text("1st -> 2nd"), onPressed: () { Navigator.push(context, MaterialPageRoute(builder: (context) => SecondPage())); }, ), ), ))); } } Here is my 2nd page without builder import 'package:flutter/material.dart'; import 'package:fluttertestpage/secondpageui.dart'; import 'package:fluttertestpage/thirdpage_0.dart'; import 'package:fluttertestpage/thirdpage_1.dart'; class SecondPage extends StatefulWidget { @override _SecondPageState createState() => _SecondPageState(); } class _SecondPageState extends State<SecondPage> { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: SecondPageUI(context).getSecondPageUIWidget() ), ); } } returning widget of 2nd page import 'package:flutter/material.dart'; import 'package:fluttertestpage/thirdpage_0.dart'; import 'package:fluttertestpage/thirdpage_1.dart'; class SecondPageUI { SecondPageUI(this.context); final BuildContext context; Widget getSecondPageUIWidget() { return Container( color: Colors.white, child: Center( child: Column( children: <Widget>[ Container( width: MediaQuery.of(context).size.width*.5, height: MediaQuery.of(context).size.height * .5, decoration: BoxDecoration(color: Colors.orangeAccent,), ), RaisedButton( child: Text("2nd -> 3rd0"), onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => ThirdPage_0()), ); }, ), RaisedButton( child: Text("2nd -> 3rd1"), onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => ThirdPage_1()), ); }, ), ], )), ); } }
d8e1151dc41b95a0181470788b1017ba9d15751efe10c94988a1976fa38a99bf
['bad0f2cf80cc4a9c83cb68428a930581']
I dont understand what's causing the error really. My code is in a seperated class with a returning Widget method, the that method returns a Stack which envelopes my Listview. Note: When I copy the Container with a Listview and modified the appropriate values of course; then paste in a new project with A Stack as a parent again, its seems to work fine. Here is the code: AddStockUI(){ Widget getAddStockUI() { final mediaSize = MediaQuery.of(context).size; return Container( width: mediaSize.width, height: mediaSize.height, color: Colors.white, child: Stack( children: <Widget>[ //Head - image Container( width: mediaSize.width * .8, height: mediaSize.height * .2, margin: EdgeInsets.only( left: mediaSize.width * .1, right: mediaSize.width * .1, top: mediaSize.height * .05, ), child: Row( children: <Widget>[ Container( width: mediaSize.width * .37, height: mediaSize.height * .2, child: Image.asset( 'assets/images/image_add_image.png', width: mediaSize.width * .37, height: mediaSize.height * .2, filterQuality: FilterQuality.high, fit: BoxFit.fill, ), ), Spacer(), Container( constraints: BoxConstraints( maxHeight: mediaSize.height * .2, maxWidth: mediaSize.width * .37), padding: EdgeInsets.all(0), child: ListView.builder( padding: EdgeInsets.all(0), physics: AlwaysScrollableScrollPhysics(), itemCount: myMapDesc.keys.length + 1, itemBuilder: (BuildContext ctx, int index) { if (index == 0) { return Container( width: mediaSize.width * .35, height: mediaSize.height * .03, child: Row( children: <Widget>[ Center( child: Container( width: mediaSize.width * .14, child: AutoSizeText( "variation", style: TextStyle(color: myLightDarkColor), maxFontSize: 14, minFontSize: 12, maxLines: 1, ), )), Spacer(), Center( child: Container( width: mediaSize.width * .1, child: AutoSizeText( "value", style: TextStyle(color: myLightDarkColor), maxFontSize: 14, minFontSize: 12, maxLines: 1, ), )), Spacer(), Container(width: mediaSize.width * .11) ], ), ); } else { return Container( margin: EdgeInsets.only(top: mediaSize.height * .025), width: mediaSize.width * .35, height: mediaSize.height * .03, child: Row( children: <Widget>[ Center( child: Container( width: mediaSize.width * .1, child: AutoSizeText( myMapDesc.keys .toList()[index - 1] .toString(), style: TextStyle(color: myLightDarkColor), maxFontSize: 14, minFontSize: 12, maxLines: 1, ), )), Spacer(), Center( child: Container( width: mediaSize.width * .1, child: AutoSizeText( myMapDesc.values .toList()[index - 1] .toString(), style: TextStyle(color: myLightDarkColor), maxFontSize: 14, minFontSize: 12, maxLines: 1, ), )), Spacer(), Icon( Icons.remove_circle, color: Colors.red, ) ], ), ); } })) ], ), ), } }
5c932349ca4a479cd8b9e705869fa0ff4229d48bf5a8f9b1e8244ae499ffd92a
['bad7e3a2d9f442719cf088726c44a04b']
I'd say the answer is no, not without so much work that it would outweigh the minor inconvenience of using Kupfer directly for the things it does well. As your examples do a great job of highlighting, it's a very useful app. Unity Dash is also useful, but its UI seems entirely oriented toward search, one-field search. (Modulo configurable filtering.) It's hard to imagine how you would bring into Dash the kind of subject-verb command composition that's part of what makes Kupfer so handy -- without essentially cloning Kupfer. And since you already have Kupfer, you don't need a clone. I don't mean to dismiss your question, but nonetheless I can't see a way to answer "yes" to it. If you're still determined, and have one specific favorite feature of <PERSON> you'd most like <PERSON> to emulate, you might try asking about that.
92140826387bbbca844bde4d2f5f0b697c8a1cedc14c64f9ff41e53a15341ec6
['bad7e3a2d9f442719cf088726c44a04b']
I have a div with two tables. I want to select the rows from only the one table having N rows. In XPath I would use: //div[@class="div1"]/table[count(tr) = 2]/tr Is there a jQuery selector expression that will do the same thing? Here's the HTML snippet: <div> <div class="div1"> <ul> <li>Line 1</li> </ul> <ul> <li>Line 1</li> <li>Line 2</li> </ul> </div> </div> I was hoping this could be done in a single jQuery selector expression (e.g., understood in this Interactive JQuery Tester ). My starting point is: 'div.div1 ul li' but that also selects the rows from the first table which only has 1 row. Of course, the "right way" to do this is add IDs or something else to the HTML so that the table can be identified uniquely, however in this instance I have no control over the HTML I am grabbing the data from. The only way I can tell which of the multiple tables to use is from the row count.
757ce75522a0abc49e89e68e3c8e300d3fc1178992e2694d1b440a2bc946f99c
['baeef2006eab42d892c1a69979776a36']
I'm just wondering to what extent I can hire someone to collect data for me. This would be secondary data, collecting patient records from clinics. I have no clue how to organize data or use databases, so the research assistant would also be helping me do that. I would, of course, be reading the patient records and interpreting them into specific variables (such as did this patient have a heart problem: Y/N). My full-time job is at the university working for a project under a PI who is not my PhD supervisor. The project funding has run out that we cannot pay for our team's salary. I applied for some funding as the PI on the project and got some extra funding. I could use the funding coming in from the new project to cover our team's salary and also utilize the team's research assistant to collect the data for the new project and for my PhD thesis at the same time. The project only needs data to caluculate the prevalence of heart problems whilst my intention for my thesis is to find out risk factors for these heart problems. I would only ask to further collect a years worth of history for each patient with a heart problem. I think this arrangement I could kill two birds with one stone but I am worried about the implications such as how much of the work should be all mine for my PhD thesis. Also, I wouldn't have to pay out of pocket to hire someone to do this for me as I'm only getting paid 81k per year.
c34c9acf132667ab1eaf5933b6c05b30cb88a34f8939af86635820bd2da97e84
['baeef2006eab42d892c1a69979776a36']
I have stumbled across this question about the Random restart algorithm in search problems: Random restart is technique which used for: a)algorithms for search in space state when they get stuck b)algorithms for informed search for better solution c)algorithms for uninformed search for better solution d)algorithms for local search for better solution My thoughts are : it's a) or d) but I cannot decide since random restart is used for local search but we don't need better solution, however I haven't found anywhere that random restart helps us getting unstuck?
e4a0a7ed616c5f1f30713894a65cf004647d80f2e5dbdcb08f5a3914aaa352fc
['bb0ddbbafbb54de98f40d3964889d6ce']
Training an Object Detection classifier with Tensorflow 1.12.2 and Python 3.6. Using about 20,000 images over 4 classes, and after 160K steps the mAP is pretty steady, but the Total Loss is still dropping (very slowly though). Should I keep training until the Total Loss ceases to drop or turns upward ?
3ea0862a1031637acff1b5b892e9c5b36192fca135242e6988ed9e8d41e0c8de
['bb0ddbbafbb54de98f40d3964889d6ce']
I've been able to get this to work in Tensorboard 1.11.0 by editing the object_detection/protos/eval.proto file, then re-running protoc (see the Tensorflow docs). For example, this line in eval.proto would enable 100 examples (instead of the default 10): optional uint32 num_visualizations = 1 [default=100]; This probably has an impact on system memory, browser performance, eval performance, etc.. so use with caution.
de6b9bcdba091240c2f445b2c8e901d17f91102068055107ee1ad654892e3f9d
['bb18ef76f42545189d7beff57380d3ef']
Entiendo que necesitarás que tanto categoría como producto estén activos.La query para obtener lo que comentas sería: queryset = Category.objects.select_related('products').filter(active=True, products__active=True) Esta query por definición te devuelve las categorías activas con sus productos activos. Dado que necesitas también los productos se usa select_related para que te lo traiga todo en una única query, incluyendo la relación, en este caso productos, de lo contrario, lanzaría dos queries una para categorías y otra para productos bajo demanda cuando quieras acceder a ellos.
897554e7d14239847bc41592f7b3f38b40056755b1a13840bd02cf004827ae36
['bb18ef76f42545189d7beff57380d3ef']
Olá ! Meu cliente precisa que o usuário seja redirecionado para a página onde ele estava acessando antes de finalizar a sessão anterior. Por exemplo: <PERSON> -> Página A (CRIOU O COOKIE) Usuário encerrou a sessão. Quando o usuário retornar ao site, ele deve ser redirecionado exatamente pra página onde ele estava anteriormente, ou seja, <PERSON> Alguma sugestão? Obrigado!
c923f9cd4f987d0f9804b056436f85b4a2c70e17edbb6616c6e147151c320b38
['bb3743cf4ae741cbbb54e03a262fd3b5']
I think I am mostly after a critique of the way I am using my Player class, and how to improve it. My spritesheet contains all the sequences I feel I need for the actions I am after. But what I would like initially, is that when my "jump" button is pressed, that the animation the character is going through is stopped, and the "jump" sequence from the spritesheet it used. (walk - for example is frame 7 through 9 where jump is frame 10 through to 13). Here is how I produce my player sprite : Player.m : -(id)playerCharacter { if (self = [super init]) { [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"Soldier.plist"]; // Create a sprite sheet with the Player images CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"Soldier.png"]; [self addChild:spriteSheet z:15]; NSMutableArray *walking = [NSMutableArray array]; for(int i = 7; i <= 9; ++i) { [walking addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"Soldier%d.png", i]]]; } CCAnimation *walkingAnimation = [CCAnimation animationWithSpriteFrames:walking delay:0.2f]; _walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkingAnimation]]; walkAnim.restoreOriginalFrame = NO; [self runAction:_walkAction]; self.velocity = ccp(0.0, 0.0); } return self; } GameLevelLayer.m player = [[Player alloc] playerCharacter]; player.position = ccp(100,50); [map addChild:player z:15]; I guess my question is .. Should I move the whole CCAnimation component of that method out of there, into a new method that is checking a series of BOOLs that define the spritesheet / animation sequences? Am I even using the above code in the most efficient way? While I appreciate that it works as it is .. I would rather understand if I am doing things correctly or not than carry on down a path that adds inefficiencies to my project. I greatly appreciate any feedback and assistance.
8710f628f7d49e0461bf98280885803fd1b1d674205e8a800a5967b82e9e5d73
['bb3743cf4ae741cbbb54e03a262fd3b5']
I would be very grateful for any advice you can offer as I am growing increasingly frustrated with an issue I am having - I also appreciate that the issue I am having is due to my lack of knowledge / understanding. In an attempt to further my knowledge and stretch myself, I have chosen to create a PlayerStats class that handles the players scoring - and in time, health, etc. I have the GameLevelLayer and PlayerStats classes implemented as follows: GameLevelLayer.m as follows: #import "GameLevelLayer.h" #import "Player.h" #import "PlayerStats.h" @interface GameLevelLayer() { CCTMXTiledMap *map; Player *player; PlayerStats *playerStats; } @end @implementation GameLevelLayer @synthesize grabber = _grabber; +(CCScene *) scene { CCScene *scene = [CCScene node]; GameLevelLayer *layer = [GameLevelLayer node]; PlayerStats *hudLayer = [PlayerStats node]; [scene addChild: layer]; [scene addChild: hudLayer]; return scene; } -(id) init { if( (self=[super init]) ) { CGSize screenSize = [[CCDirector sharedDirector] winSize]; playerStats = [[PlayerStats alloc]init]; ........... } PlayerStats.m is as follows: -(id) init { if ((self = [super init])) { CGSize screenSize = [[CCDirector sharedDirector] winSize]; score = [CCLabelTTF labelWithString:@"Score : 0" dimensions:CGSizeMake(100,20) hAlignment:UITextAlignmentRight fontName:@"Marker Felt" fontSize:(18.0)]; int margin = 5; score.position = ccp(screenSize.width - (score.contentSize.width/2) - margin, score.contentSize.height/2 + margin); [self addChild:score z:99]; } return self; } -(void)numberOfItemsCollected:(int)collected { NSString *str = [score string]; CCLOG(@"What does the label say %@", str); // This is actually displaying the correct string of what the score should be .. [score setString:[NSString stringWithFormat:@"Score : %d", collected]]; } When (from the GameLevelLayer.m) I initiate [playerStats numberOfItemsCollected:5]; the CCLog shows that the label should show Score : 5 but the label itself does not update. Any advice would be greatly appreciated as I am very aware that I am misunderstanding the issue. I think the issue is to do with the Layer that I am updating not being the one I believe it is.... Thanks in advance.
bda98ea6ea6c203472b18013f7e8feea35341a3f6aadf1a00c7038b528c8afe9
['bb4cab49af5b45acb706380271978fe9']
In OOP terms, those are all "classes". Whether or not they require the new keyword, value type mechanics, etc. are all implementation details of the C# language, not OOP concepts. At a conceptual level, yes, they are all classes in the OO sense. In C#, the OOP term "class" is devided up into two types, normal classes and structs. Normal classes are treated as reference types, while structs are treated as value types (see here for a discussion of the difference). The primitive types you mention (int, bool, char) are aliases to structs. That basically means behind-the-scenes, the compiler creates a new instance of the struct type for you. For example, int is an alias to System.Int32, so you can use the two interchangeably. This again is an implementation detail - it doesn't mean they're not classes, it just means the compiler is trying to simplify things and make life easier for you.
386baa70cd7e5d69d1f48241ef17e5d353f9ae22d0e86c47545203356755b427
['bb4cab49af5b45acb706380271978fe9']
EF 5 can work in several different models, depending on how you want to use it. There are templates for using context-tracked entities, self-tracked entities, or POCOs. For your case, I would recommend not keeping your context object around. Self-tracking entities are probably what you're looking for - they store internally all of the information needed to update the database instead of relying on the context to track it. If you go the self-tracked route, then your OnDataArrived method would just create a new context object and update the entity, which would also address the threading issue mentioned by weismat.
a686550b070d515260f64f4faf0fe6fa946d75142c081ee0e0ae6fd4df45faa1
['bb4f6c07418340dda46567ab4fbf7a09']
I am developing a node.js app locally on Mac OS X 10.9.5 that proxies requests for large files on another server. I have tried writing my app using node-http-proxy, and also with a simple http/request one-liner (req.pipe(request()).pipe(res)). Both work fine until I start making e.g. 30 simultaneous requests to my proxy for a large-ish(90MB) file. Tailing the access log on the backend server, I can see that only a portion of my proxied requests appear immediately. The others trickle in many seconds and sometimes minutes later. In some cases, the later outbound requests correspond with the completion of some of the requests that arrived immediately, and in other cases I see no patterns as far as what is unblocking the requests. The number of requests that make it out to the backend server immediately is inconsistent. I have tried setting http.globalAgent.maxSockets to a number much larger than my 30 requests, but this does not make a difference. Any other ideas as to what could be delaying a subset of my outbound HTTP requests?? Thanks!
e7abb897413df89f335ba351fcfb7329b94cbfc901dfe13035568cc806ae3c6a
['bb4f6c07418340dda46567ab4fbf7a09']
I just installed TortoiseGit and Putty and was able to successfully clone a repo from git.ng.bluemix.net via SSH. I followed these directions to ensure I was using Pageant to configure my SSH key: https://tortoisegit.org/docs/tortoisegit/tgit-ssh-howto.html Can you share more details on what exactly you're seeing? What happens when you attempt git clone via SSH in a DOS prompt?
cd80cc1afafd37d5dd50e0546e36c0b2b6224657a72544fb46ec843a3ad96543
['bb5a3b9d35884626b33de9210960f6f9']
Здравствуйте! Может кто-то мне подсказать как правильно сконфигурировать зуукипер для работы кликхауса через него? Сейчас у меня пока 2 сервера, на которых установлены зукипер и кликхаус, на одном из них есть реальная база, которая работает. Задача сделать еще 2 реплики для отказоустойчивости. Конфиги зукипера сейчас выглядят так: zoo.conf tickTime=2000 initLimit=30000 syncLimit=10 maxClientCnxns=2000 maxSessionTimeout=60000000 dataDir=/opt/zookeeper/ch-1/data dataLogDir=/opt/zookeeper/ch-1/logs clientPort=2181 server.1=server1.ru:2888:3888 server.2=server2.ru:2888:3888 autopurge.snapRetainCount=10 autopurge.purgeInterval=1 preAllocSize=131072 snapCount=3000000 leaderServes=yes standaloneEnabled=false dynamicConfigFile=/etc/zookeeper-{{ cluster['name'] }}/conf/zoo.cfg.dynamic environment NAME=zookeeper ZOOCFGDIR=/etc/$NAME/conf CLASSPATH="$ZOOCFGDIR:/usr/share/java/jline.jar:/usr/share/java/log4j-1.2.jar:/usr/share/java/xercesImpl.jar:/usr/share/java/xmlParserAPIs.jar:/usr/share/java/netty.jar:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-log4j12.jar:/usr/share/java/zookeeper.jar" ZOOCFG="$ZOOCFGDIR/zoo.cfg" ZOO_LOG_DIR=/var/log/$NAME USER=$NAME GROUP=$NAME PIDDIR=/var/run/$NAME PIDFILE=$PIDDIR/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME JAVA=/usr/bin/java ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain" ZOO_LOG4J_PROP="INFO,ROLLINGFILE" JMXLOCALONLY=false JAVA_OPTS="-Xms{{ cluster.get('xms','128M') }} \ -Xmx{{ cluster.get('xmx','1G') }} \ -Xloggc:/var/log/$NAME/zookeeper-gc.log \ -XX:+UseGCLogFileRotation \ -XX:NumberOfGCLogFiles=16 \ -XX:GCLogFileSize=16M \ -verbose:gc \ -XX:+PrintGCTimeStamps \ -XX:+PrintGCDateStamps \ -XX:+PrintGCDetails -XX:+PrintTenuringDistribution \ -XX:+PrintGCApplicationStoppedTime \ -XX:+PrintGCApplicationConcurrentTime \ -XX:+PrintSafepointStatistics \ -XX:+UseParNewGC \ -XX:+UseConcMarkSweepGC \ -XX:+CMSParallelRemarkEnabled" configuration.xls <?xml version="1.0"?> <yandex> <zookeeper> <node index="1"> <host>server1.ru</host> <port>2181</port> </node> <node index="2"> <host>server2.ru</host> <port>2181</port> </node> <macros> <layer>01</layer> <shard>01</shard> <replica>server1.ru</replica> </macros> </zookeeper> </yandex> сам зукипер сервер запускается без ошибок и через клиент я могу к нему подключиться. ZooKeeper JMX enabled by default Using config: /etc/zookeeper/conf/zoo.cfg Starting zookeeper ... STARTED я пытаюсь создать реплику на втором сервере примерно таким запросом CREATE TABLE my_table(date_full_created, datetime_created, year_created, month_created, date_created, my_id, news_id, title) ENGINE ReplicatedMergeTree( "/clickhouse/tables/2/my_table","{replica}", date_full_created, ( datetime_created, year_created, month_created, date_created, my_id, news_id ), 8192); но ничего не происходит. что еще мне надо сделать, чтобы создалась реплика базы на 2 сервере и происходила синхронная запись в обе базы?
447532ba803ee9087cbd9b93028fcf021958c5e7b834dfa24359597f4879e3d0
['bb5a3b9d35884626b33de9210960f6f9']
What is the correct syntax for XSD schema to define the following restriction: In the list of elements we have to specify that attribute can contain value of "c" unlimited number of times, but value of "b" - the zero or only one time. For example, the correct xml looks like this: <root> <elem atr="c">111</elem> <elem atr="c">222</elem> <elem atr="b">333</elem> <elem atr="c">444</elem> <elem atr="c">555</elem> </root> And incorrect one is: <root> <elem atr="c">111</elem> <elem atr="c">222</elem> <elem atr="b">333</elem> <elem atr="c">444</elem> <elem atr="b">555</elem> </root>
84cdff44c32636e917c5220cb6ce2d63f4ab37d6984908991d2dde76aa0f0f90
['bb5ccc6dea4c45b7a6a3ebca1247fb72']
So say I make a controller for a main menu 'page', would MainMenu be composed of the individual view elements like labels and buttons directly or would it reference a class such as MainMenuView which had those elements instead? Or would it just send events to an event system to communicate with the view? Or something else?
cb25b097d90ab1951403a9e745848ca83f2550ec2191856174508575384bbfb3
['bb5ccc6dea4c45b7a6a3ebca1247fb72']
I thought that normally when you branch, you branch the whole trunk, but in my company I've seen people branch subfolders of trunk and deeper- are there any practical consequences of this besides confusion when you try to find the right directory in the trunk to merge back into?
579ebf5d1e19cda80bd0d53d44665bcfee079f37d548441e10270cfa21790916
['bb62783a8640437a97dca13e36698aa4']
First of all, you should upgrade to cuda 8. This error fatal error: cub/cub.cuh because the compiler can not find this file. If you use cmake, you must add cub directory by the command include_directories, if you use IDE or something else, try to add cub directory to your project.
42dc39fe6d52e93edc876600c7ed5555e952214441875547335fccca3d50692a
['bb62783a8640437a97dca13e36698aa4']
I'm looking for a good approach to compute the determinant of a binary NxN matrix. So far I found this: https://github.com/OrangeOwlSolutions/Linear-Algebra/blob/master/DETERMINANT/determinant.cu, but this implementation may be good for general matrix (floating point) while I only need to work with integers. Also, cuBLAS or cuSOLVER only support double-precision matrices.
c9e542f5dde6fb39fac7c696a8dcf1a906aa65d82d0357a62b5754c98d95973b
['bb630ef6a75c4f819e6ee574158c578c']
I am able to get the Username, UID and GID from SCDynamicStoreCopyConsoleUser using python: #!/usr/bin/python from SystemConfiguration import SCDynamicStoreCopyConsoleUser cfuser = SCDynamicStoreCopyConsoleUser( None, None, None ) print cfuser[0] # Returns console user, e.g.: myUsername print cfuser[1] # Returns console user’s UID, e.g.: 501 print cfuser[2] # Returns console user’s GID, e.g.: 20 How can I get this same return using Swift? Swift Declaration of SCDynamicStoreCopyConsoleUser func SCDynamicStoreCopyConsoleUser(_ store: SCDynamicStore!, _ uid: CMutablePointer<uid_t>, _ gid: CMutablePointer<gid_t>) -> Unmanaged<CFString>! My Swift Call var uid: CMutablePointer<uid_t>! var gid: CMutablePointer<gid_t>! var cfuser: NSArray = [SCDynamicStoreCopyConsoleUser(nil,uid,gid)] // the return has only one element containing the username
fc19987884cc31ea7c80cf19aa49bec92f402c765f6e6fc5a580fafdff2a3242
['bb630ef6a75c4f819e6ee574158c578c']
Given the below XML, what is the correct XPath expression to extract the id value for a given name value? (eg: I want xmllint to return an id value of "someID" when given a name value of "someName") <?xml version="1.0" encoding="UTF-8"?> <record> <attributes> <attribute> <id>someID</id> <name>someName</name> </attribute> <attribute> <id>someOtherID</id> <name>someOtherName</name> </attribute> </attributes> </records>
d296c487b551440953c07fe759b0320d64b666e44f842db6624fd492644cc4a3
['bb63b4cbcb5f43528cb25f60a17d1180']
I have a function that will send emails from google sheets. I would like to compose the email subject and body in the sidebar option in google sheets hit send and have the subject and body past as variables to the server side function to send the emails. I hope I was able to clearly explain what I am asking. I have VERY little programming knowledge so please excuse me. I have my current coding below and any improvements or fixes would be greatly appreciated. function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu('Email') .addItem('Remaining Email Quota', 'emailQuota') .addSeparator() .addItem('Send Email', 'sideBar') .addToUi(); } function sendEmail(formSubject,formBody){ var app = SpreadsheetApp; var sheet = app.getActiveSheet(); var lastRow = sheet.getLastRow(); for (var i = 5; i <=lastRow;i++){ var currentEmail = sheet.getRange(i,4).getValue(); var emailConfirm = sheet.getRange(i,1).getValue(); if(emailConfirm == "Yes"){ if(currentEmail !=""){ MailApp.sendEmail(currentEmail, formSubject, formBody); } } } } function sideBar(){ var html = HtmlService.createHtmlOutputFromFile('sideBarEmail') .setTitle('Email Subject & Body').setSandboxMode(HtmlService.SandboxMode.IFRAME) .setWidth(400); SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp. .showSidebar(html); } HTML Portion Below__________________________________________ > <base target="_top"> > <script> > function onSuccessSubject(getSubject){ var subject = document.getElementById("formSubject"); } > google.script.run.sendEmail(); > > </script> </head> <body> > > > <form> > > <form id="formSubject"> > <p> Subject:<br> <input type="text" name="subject" size="36"> </p> > </form> > > <p> Body:<br> <textarea name="body" rows="15" > cols="37"style="Left"></textarea> </p> > > <input type="button" value="Send" onclick = > "google.script.run.withSuccessHandler(onSuccessSubject).getSubject();"/> > > <input type="button" value="Cancle" onclick="google.script.run > .withSuccessHandler(showConfirmation(document.getElementById('subject').value)) > .processData(document.getElementById('subject').value)" /> > > </form> > </body>
f7c173cf5f9e55f45b25ad332dc939e9af72d68e8e5b70a684015dfd81a5d567
['bb63b4cbcb5f43528cb25f60a17d1180']
I need help with setting up a google sheets sidebar to accept input for the subject and email body? I have been able to get one to work but not both. Code below.... <head> <title>Test Page</title> </head> <body> <form> Email Subject:<br> <input type="text" name="subject" size="36"> Email Message:<br> <textarea name="body" rows="15" cols="37"style="Left"></textarea> <p> <input type="button" onClick="formSubmit()" value="Submit" /> <input type="button" onClick="google.script.host.close()" value="Cancle" /> </form> </body> <script type="text/javascript"> function formSubmit() { google.script.run.sendEmail(document.forms[0],document.forms[1]); } </script>
d470049f7cd3e8a27021c5591f685d4134449eff3332812042c4dce04ee7d727
['bb6a50c6cb224df487a7927fb6828bd0']
In lines 41 and 42, push(stack,br); and pop(stack); I am getting the error "Method in type not applicable" Any ideas what's causing it, and how to avoid doing it in the future? Thanks public class Reverse2 { public static void push(Stack<String> stack,BufferedReader br) throws IOException { String line = br.readLine(); while ( line != null) { stack.push(line); line = br.readLine(); } } public static void pop(Stack<String> stack) { while (stack.isEmpty() == false) System.out.print(stack.pop()); } public static void main(String args[]) throws IOException { stack stack = new stack(); Scanner K = new Scanner(System.in); String filename; System.out.print("Enter filename "); filename = K.next(); BufferedReader br = new BufferedReader(new FileReader(filename)); push(stack,br); pop(stack); br.close(); } }
69a10bd49f13c9ea65e794a5401d81822259544970fee4dff4af3a3e0bdc6d42
['bb6a50c6cb224df487a7927fb6828bd0']
I've been working on a program that creates Rational numbers, and when I call any of these methods I get a stack overflow from recursion. public Rational(){ new Rational(0,1); } public Rational(int n){ new Rational(n,1); } public Rational(int numerator, int denominator){ new Rational(numerator,denominator); } Can someone explain to me why these methods infinitely recurse?
fad2202c7ada5c5c978e6a08a3b950ca6672deae2ad119defa11c66814cb22de
['bb6a57c420854059a92996979c11d59b']
If I want to pull all the actors' names, I tried this, but it only pulls one name. Is there a repeat loop or anything else I can do to have it pull all the tags that say <span itemprop="name">? set astid to AppleScript's text item delimiters set startHere to "<span itemprop=\"name\">" set stopHere to "</span>" set mysource_html to do shell script "curl https://play.google.com/store/movies/details?id=H9EKG4-JHSw" set AppleScript's text item delimiters to startHere set blurb1 to text item 2 of mysource_html set AppleScript's text item delimiters to stopHere set blurb2 to text item 1 of blurb1 set AppleScript's text item delimiters to astid
6e6e0006b8002a6d9372718988a39a8b5ee22dff8f08953ee7cf7c42cdc55f11
['bb6a57c420854059a92996979c11d59b']
I am trying to compare two dates in Google Docs using Apps script. My dates are formatted m/d/yyyy h:mm:ss. I keep getting an error saying "Cannot find function getTime in object 2/1/2013 9:42:46." Is there a problem with the way my dates are formatted? I've used this before successfully for dates that are formatted mm/dd/yyyy, and am not sure why adding the timestamp would make a difference. Any help would be greatly appreciated! for (var i = 0; i < kValues.length; i++) { // repeat loop if (kValues[i][0] == "") {var lastupdate = parseInt(new Date("1/1/1980 00:00:00").getTime()/day); } // if a date doesn't exist, throw it back in the past if (kValues[i][0] != ""){ var lastupdate = parseInt(kValues[i][0].getTime()/day);} // if a date does exist, interpret it. Here's where I'm getting my error. var statusDateChange = parseInt(statusDate[i][0].getTime()/day); // interpret a date from Sheet 2 var statusChange = changeStatus[i][0]; //find the new status var currentStatus = status[i][0]; //find the old status var currentOID = oid[i][0]; // set Order ID var changeOID = statusOID[i][0]; // set Order ID in Sheet 2 to compare Logger.log(lastupdate + "<=" + statusDateChange); if (lastupdate <= statusDateChange && currentOID == changeOID && statusChange != currentStatus) {sheet.getRange(i + 2, 8, 1, 1).setValues(statusChange); // if the date in Sheet 1 is less than the date in Sheet 2 and the ID matches, change the status } }
7ef94f344b828adf1c3c4bca9a1784ab949d25d5a2236d12521d52eb48519355
['bb6c9511cdc54aeca30ec46960ed1d31']
<PERSON> Yes this certainly is the first part, as i figured out before, but the problem is the width of image. If it is too long it does not look centered anymore since 0,0 coordinates of image start in center, but image's width itself reaches to the right. I guess i should move image to left after using your formula but dont know for what value.
3ca91c2f7976b07ca95edf13e09d122a0bbf2aacbea6fc63627dc53f2654a64c
['bb6c9511cdc54aeca30ec46960ed1d31']
Using this post hoc in my full model results into a significant interaction of `poverty*children` However, reducing the model by AIC criterion (even without a significant difference between models) ends into a model where only factor `poverty` is significant. This significance I cannot claim from the full model due to involvement in interaction. It feels like bad science to describe both procedures. However, if I only state the effect of `poverty` in the reduced model I miss the information that this effect mainly occurs due to an interaction in `poverty*children`.How is best to proceed?
f35b6ddf43991b96dd197f2656adf30717c07f00fe2464b92b9ff463d8aada94
['bb6d5fe97f7f4e2db8e9754b7ffe6e37']
Tenho uma tag header, onde está meu menu, está tag header tem width de 80% da tela e está fixada no topo. Tenho logo abaixo do menu uma imagem, que quero que pegue 100% da tela, porém está dentro da mesma tag header. Tem como esta imagem não pegar o width da tag header, e ao invés disso ficar com 100% da tela, mas mesmo assim ficar fixada no topo junto com a header?
6845a55e3f6e8fab795865c8581df482f574255cfdc7df032ded13fc6fb35fda
['bb6d5fe97f7f4e2db8e9754b7ffe6e37']
Easiest is probably scrounging a used truck rim. You might want to keep it above ground this lets you regulate the air with vents for a good burn. A sunk pit won't draw air as well or radiate heat. OTOH it might use less wood. If you don't use fire rated lining burn a small fire to dry out the cinder blocks then your regular fire the next night. Less likely to break up from the gas pressure. So i'm told, don't know if I believe it LOL. I like the dead BBQ idea.
351add79e8f280c8dde075da27384c26dedc3cfbd8088974d4979ad5cac86fbf
['bb9a3ec075d54c0d92682678f4be6dd1']
I'm making a form for my website and there's an empty space in between the first label and input. When I remove the label, everything goes back to normal but I'd like to use the label. Thanks in advance to anyone that can help. <form id="contactForm"> <div class="tableRow"> <p><label for="name">Name</label></p> </p><input type="text" name="name"></input><p> </div> <div class="tableRow"> <p><label for="email">Email</label></p> <p><input type="email" name="email"></input></p> </div> <div class="tableRow"> <p><label for="comments">Comments</label></p> <p><textarea cols="48" rows="10" name="comments"></textarea></p> </div> </form> and here's my css #contactForm{ margin: 0 auto; display: table; } .tableRow{ display: table-row; } .tableRow p{ display: table-cell; vertical-align: top; } .tableRow p:first-child{ text-align: right; }
300d714009bda0a652d9bdaa242d347755085e715095720635fd33580beb8e1f
['bb9a3ec075d54c0d92682678f4be6dd1']
I am trying to make rectangles appear randomly on a canvas, and am trying to make the colors of the rectangles be chosen randomly from the array colors. It works when I set the value of context.fillstyle to a color, but when I set the value of context.fillStyle to RandomColor, the rectangles become black. Any help would be appreciated. Thanks in advance. <!DOCTYPE HTML> <html> <head> <script> function init(){ var canvas = document.getElementById("canvas"); var context = canvas.getContext("2d"); var x = Math.floor(Math.random()*100)+1; var y = Math.floor(Math.random()*100)+1; var width = Math.floor(Math.random()*300)+1; var height = Math.floor(Math.random()*100)+1; var colors = ["green", "blue", "red", "pink", "yellow"] var randomColor = colors[Math.floor((Math.random)*colors.length)]; context.fillStyle = randomColor; context.fillRect(x,y,width,height); } </script> <form> <input type="button" value="submit" onClick="init()"> < /form> </body> </html>
9226c5cbbd6a2ff43168bf5407c4e8ead1e356063524203bf32ed0b70976cb3e
['bbc388cb627245e4b6fa28d6b4946c88']
From the information, I infer that you're trying to invoke the validate method of the Validator class. Also, sounds like you have to grasp the concept of static and instance in OOPS. First I will give you an overview of the concept and then the answer. There are two types of method and fields in Java. Object/Instance Method and Fields: This is limited to the scope of individual objects of that class. You cannot call this method/Fields with that class name. The value present for a field in one object will not affect the value of others Static Methods and Fields: This belongs to the class scope and it is shared across all objects of that class. If one objects change the field value, it will also reflect on other objects Static Fields can be called from the objects of that class but the static method can only be invoked from the defined class Solution The validate is a static method located in Validator class, So you have to call (Validator.validate(policy)).
ff3eed825936fd8423a26a8e27d2c2eac64d15595c48ea2f1dd4252f41e54800
['bbc388cb627245e4b6fa28d6b4946c88']
If your question is about going from moving switch b to switch a. Then you can use the recursion for this purpose. I don't know about return types. So the prototype is Write the switch(a) in a method. Let's name this method as method1. write switch(b) in a method. Let's name this method as method2. method1(Object a) { switch(a): case 1: //Your code here if(condition1) { method2(a); } } method2(Object b ) { switch(b): if(condition2) { method1(b) } }
28e22e0001fbb4683b91d835d519ce5c4485126704ec60cc1a3b35051e31ee9e
['bbc64283cd0949378dee9735c2047393']
I am trying to implement CI on ios. I am running xcode unit tests from commandline using xcodebuild on a real device (iPad): xcodebuild test -project MyProject.xcodeproj -scheme tests DEVELOPMENT_TEAM={DEV_TEAM_ID} -destination platform=iOS,id={DEVICE_UUID} build-for-testing -allowProvisioningUpdates -configuration {Debug/Release} I've got a single unit test which contains NSLog calls inside. The problem is that those logs are not displayed in the terminal window in which xcodebuild was called: Test Suite 'Selected tests' started at 2018-06-07 05:10:45.653 Test Suite 'XcodeTests.xctest' started at 2018-06-07 05:10:45.655 Test Suite 'XcodeTests.xctest' failed at 2018-06-07 05:10:45.655. Executed 1 test, with 1 failure (0 unexpected) in 0.000 (0.00) seconds Test Suite 'Selected tests' failed at 2018-06-07 05:10:45.656. Executed 1 test, with 1 failure (0 unexpected in 0.00 (0.003) seconds I've looked into the device logs from Xcode's Window->Devices and Simulators-> View Device Logs and it looks like they are there but as Notice (perhaps the fact that they are Notice matters): Jun 7 05:10:45 MyiPad tests(XcodeTests)[21982] <Notice>: ENTERED TEST Jun 7 05:10:45 MyiPad tests[21982] <Notice>: CREATED EXPECTATIONS I've tested this launching method on another mac with another attached iPad and it strangely works. The configuration from the machine on which it worked to display the NSLog messages in the terminal is the following: System Software Overview: System Version: macOS 10.13.2 (17C88) Kernel Version: Darwin 17.3.0 Boot Volume: SYSTEM Boot Mode: Normal Computer Name: Mac001 User Name: MacUser001 Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 7 days 48 minutes XCODE VERSION DETAILS: Xcode 9.2 Build version 9C40b Device iOS Version: 11.2 (15C114) The other configuration on which it doesn't show the NSLogs in the terminal is the following: System Software Overview: System Version: macOS 10.13.3 (17D47) Kernel Version: Darwin 17.4.0 Boot Volume: SYSTEM Boot Mode: Normal Computer Name: Mac002 User Name: MacUser002 Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 7 days 48 minutes XCODE VERSION DETAILS: Xcode 9.2 Build version 9C40b Device iOS Version: 10.2 (14C92) What could be the problem? Could it be from the device or the mac workstation? (I don't have physical access to any of them, just remote to the mac).
453f95659ab3cc70e74bba7f845aebe7c494c01f650fab40bf138c3f908dcea3
['bbc64283cd0949378dee9735c2047393']
Indeed for iOS versions 10+, it looks like the NSLog is treated like a < Notice > message and is not included in the stdout or stderr outputted by xcodebuild. I found that out by looking into the device console log. I found the solution that <PERSON> mentioned a while ago, but I wasn't sure if this is a common issue (thanks <PERSON>). Using printf instead of NSLog is the only way to print the messages for this particular case.
73472d4694a6be6145986a5369401ac01bfcbdd2bf7899b788e3fb35653b0519
['bbd306e5f75144bda03912f83167242f']
I have a simple app where the only view controller has an outlet to a UITabBar. It also implements UITabBarDelegate and is set as the delegate for the UITabBar: @interface TheMainViewController : UIViewController <UITabBarDelegate> { IBOutlet UITabBar *theTabBar; } I implemented the following method Which gets called whenever any of my 4 UITabBarItems get tapped. I tried just doing something really simple: - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { tabBar.selectedItem = [tabBar.items objectAtIndex:0]; return; } In theory, it should always stay selected on my first tab and it works perfectly when I just tap any UITabBarItem (nothing happens, the first one always stays selected). But when I touch a UITabBarItem and hold it (not taking my finger off) the selection changes anyway ! Debugging, everything gets called properly. It's like changing the selectedItem property doesn't have any effect is the user still has the item "down" (with his finger on it). What would be a good workaround? I tried overloading UITabBar and messing with touchesBegan and touchesEnd but they don't even get called. Same with UITabBarItem. Oh and please don't suggest using a UITabBarController as it is not flexible enough for my application. So frustrating....thanks!
a801c648bff4bc13a477d40cd6f1477d518605528345dedae245271999a2975c
['bbd306e5f75144bda03912f83167242f']
If I increase my velocity by 1m/s/s, how could I *not* approach 299,792,458 ? I understand that it takes more and more *energy* to actually reach that number to the point it becomes an impossibility, but why can't I use that limit to detect what's happening outside my elevator? Also, regarding RELATIVE velocity, ok suppose I was moving "backward" at (c - 1m/s), then my acceleration can go "forward" no more than 2*c. I can't be moving in *any* direction faster than c, so the most I can go in the "opposite" direction is just under 2.0*c
8e1614639d28a2ab2fefd1dc81e4342480ab063792ebbf6860485fa1453dde4a
['bbe310d0fce04cb89a63b1c41984aba5']
You could try Parallel<IP_ADDRESS>ForkManager, which provides "A simple parallel processing fork manager" for perl. You could alter the maximum number of processes up and down based on how heavy the query is, and also use nice/ionice to prevent undue stress to the server. As long as you have version 0.7.6 or later, you can pass data structures back to the parent process, which would allow you to post-process the results (e.g. show a summary).
b5e537f071fb4fe6e69633be94fec72c7c3f83d08a75fc91f39986b80fe2f0f4
['bbe310d0fce04cb89a63b1c41984aba5']
I'm trying to run gradlew in an Android Studio terminal to setup SonarQube however I get error: ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk-11 .0.2\bin. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. I can sucessfully run java --version from Windows Command Prompt so I know that I have the Java SDK installed correctly. I've already tried Rebooting Removing \bin from JAVA_HOME and Path system variables Tried these same things with JDK 12
b34411b79ffebb15270b486e77a700901de55c318182330623eadbdfd47078d8
['bbf0b3267e5046c0bc7a174342ab2552']
I've been developing an ASP .Net application for several months and two weeks ago I faced a strange error. It appears in dynamic javascript code that seems malicious. The appearance of the error doesn't depend on my changes in code. Now it takes place even in old versions of the project where everything worked fine. Moreover, I tried to run the app on another machine where I had been successfully developing it until two months ago. Even the old code saved on that machine ran with the error. It looks like some updates in the framework may have broken my code. What could be the problem and how can I fix it? Any ideas?
0ff7a0775c36748cf23d7ffbcaf8c10aaada670c269bd23b99e6dc1bc5904063
['bbf0b3267e5046c0bc7a174342ab2552']
Thank you everyone. I've found the solution. That was an installer of a web project. Of course I turned IIS on to run it. But for Win 7 that is not enough - IIS 6 Management Compatibility must also be active. I hope, this post will help someone to avoid this error.
dab4819567dca0de978906b3d6b9a1c5821d7a74508461f1a5b43f4ad37983c1
['bbfe17e638d24067a61114e1ab054266']
Using direct path (<IP_ADDRESS>), I was able to load 236,126,040 rows in approx 17 minutes. Same file split into 5 files (each about 47m rows), were loaded using external table interface under 6 minutes. So, i am sure you can do some tweaking there . Use direct path load, explore external table option as well.
6c35f5b9aa17f2da2f5df56959c310297ed187cb518205fe65ce866e4bf3c201
['bbfe17e638d24067a61114e1ab054266']
Not everything you run is eligible to be shown in DHASH (or V$ASH). When Oracle samples sessions, the session must be on CPU or must be waiting for a non-idle wait event. If your sessions do really really small transactions really quickly, it is very likely they will not be picked up. Other than using colored_sql there isn't much you can do.
6e00ca6db6d6b7ca901b9f21adc2d52fb4252964cc23e57344e1bb254f71d73a
['bc359c677a6448f18dfb2c24932f440d']
I was wondering how to disallow anyone typing in a url similar to www.example.com/?q=http://www.evilsite.com and instead redirect them to a 404 page or something else. As you can see, this introduces a phishing vulnerability. I know that somehow this is possible as I've seen previous installations redirect FYI I currently have clean URLs enabled. My installation is drupal 6.x
202683762914b6e089fcbc229711abcce82716142e79c14a8b476bbfbe1efa89
['bc359c677a6448f18dfb2c24932f440d']
I'm fairly proficient in MySQL but I have never run into such an issue. I have a record in the "node" table which is the following: nid: vid: type: lang: title: 1 5 oa_group und CPA 2014 Actions However when executing the following query: SELECT * FROM `node` WHERE `title` = "CPA 2014 Actions" the result set is 0. This record was imported through a CSV and for some reason, similar queries acted upon records NOT imported via CSV work fine. Is there any explanation for this behavior?
faa51da505e06bc43c0897bb69cc22d46d297d92052a7b5037e8cd76301e69a5
['bc392060aeeb426799e58faefb83b322']
I tried a few other solutions, but I think I've found the best for me by myself. public static final ThreadStatus threadStatus = new ThreadStatus(); public static class ThreadStatus { private Exception exception = null; public void setException(Exception exception) { if(exception == null) { return; } this.exception = exception; } public Exception getException() { return exception; } public boolean exceptionThrown() { return exception != null; } } Then in the thread's run() method: catch(Exception e) { Main.threadStatus.setException(e); } And within the loop which iterates through all lines: if(Main.threadStatus.exceptionThrown()) { throw Main.threadStatus.getException(); } Thanks to all who helped me.
7ca7ca763da51ef71d4a9a11df7c6f94cd14f1a77a7e315cc8887ec7e479f767
['bc392060aeeb426799e58faefb83b322']
There are multiple SQL queries for every project I need often. My problem is, all my projects need the same MySQL connection in Workbench. So I have a huge amount of SQL tabs opened all the time, which looks like this: Because the amount of tabs exceed the width of my monitor, I have to scroll left and right to get to some queries. The only way to do this is to click on the two arrows (right side on the screenshot). That's really unclear and annoying. Is there a better way to handle that? Is it possible to quickly switch between multiple SQL tabs or to arrange them in another way?
3f23a0634a8313d5f08613c24289822020bba4f4c3a3998c813d76f854a9ce5d
['bc46ce1645844aab874ecd6c68df3501']
We currently have an existing ASP.NET application that we want to migrate to DNN. Unfortunately, due to time constraints, we need to move it piece-by-piece (or function-by-function... however you want to look at it). And, we would like to leverage the current (DNN 6.0) version of the membership, roles and profile providers in our existing application while we are moving to DNN. I seem to have the membership provider working, but, I am having one of those 'what is the best way to do this' moments in regards to the roles and profile providers. So, my questions are: Should I create a custom provider for roles and profile providers leveraging code from the DNN core? Has anyone else done this? Or can/should I leverage the DNN assemblies for these? I'm very interested to know if this is even possible (just using the assemblies, updating web.config, etc.)?? Any other suggestions would be greatly appreciated! Thanks in advance!
f58b584939fb6e684623faf8dbad37a57c0732dc4b0cd02b47f43371ab389d17
['bc46ce1645844aab874ecd6c68df3501']
When you create a new build in VS 2010, the entire build configuration is saved in the database, their is no configuration file created by default. You can use .proj and .rsp files to configure your build still, but, you need to change your build to use the upgrade template for the build process file. Then the build process parameters will require a configuration folder path (to point the .proj file). If you don't change the configuration for your build (in VS 2010), the build types folder won't be created and the configuration files will not be copied to your build server.
abfc76c9431be5d9567d1144058e8d9d19afcbcf13de42997e4ec24962e061f1
['bc4b925b6f814b368a4bd0a911a25df0']
1 Are you using typescript. 2 You get an error message because the type is e.target.value string. 3 For everything to work you must convert the string to a number. <input id="methodology" placeholder="Select a methodology" value={apiData.idMethodology} onChange={e => setApiData({ ...apiData, idMethodology: +e.target.value }) } But be careful! if you enter an input that is different from the number, get NaN .
814f6a68765ed5af76be90b7806e241e38199657c030a22844581c85fcdd84a5
['bc4b925b6f814b368a4bd0a911a25df0']
this may code Schema import { gql } from 'apollo-server-express'; export default gql` extend type Mutation { signUp( lastName: String! ): String! } `; Resolvers { Query: {}, Mutation: { signUp: async ( _, { lastName} ) => { try { console.log(lastName) return 'ok'; } catch (error) { return 'error'; } }, }, }; Request mutation($lastName:String){ signUp(lastName:$lastName) } Query Veriables {"lastName":"Darjo" } I can’t understand, but I get Error "Variable \"$lastName\" of type \"String\" used in position expecting type \"String!\".", but when I remove the sign ! lastName: String everything is working. I just can’t understand. What is the reason ?.
6cab5789947b77388b0424d48517328670529d2af4af1d2f9168763f34c5d1b1
['bc5920c4b66c4546921e986e6920f06d']
import random flips = 0 heads = 0 tails = 0 while flips < 100: if random.randint(1,2) == 1: print("heads") heads += 1 else: print("tails") tails += 1 flips += 1 print("you got ", heads," heads, and ", tails," tails!") input ("exit") Changes made: starts from 0 and is only raising count when a flip has been made (also, flip is made every iteration as the cases are contained enough) also, im not casting the toss to a seperate variable but comparing it immediately. my output was: you got 54 heads, and 46 tails! exit without listing the seperate flips Note; this was the first time I ever wrote python. If there's room for optimalisation, let me know!
5902f477b02e96ab3fa3d5f05c94e8c37f4e23b4d1470778600bf001d3b86c41
['bc5920c4b66c4546921e986e6920f06d']
As long as display is set to none, you can try to force it to become visible what you want, but the browser wouldn't have the slightest clue in what context to render. you'll want to use "visibility: hidden;" on the sub-cat-1 div instead of "display: none;" and I'd expect it to work fine :)
6387f2a4c4437eb7c79448837b87987f673ca82e2c37998af9a06ef249b7d589
['bc5d782f3f8c4064b1f268c55b497e03']
TensorFlow creates a graph with the weights and biases. Roughly speaking while you train this neural net the weights and biases get changed so it produces expected outputs. The line 131 in fully_connected_feed.py (with tf.Graph().as_default():) is used to tell TensorFlow to use the default graph. Therefore every line in the training loop including the calls of the do_eval() function use the default graph. Since the weights obtained from training are not resetted before evaluation they are used for it. eval_correct is the operation used instead of the training operation to just evaluate the neural net without training it. This is important because otherwise the neural net would be trained to them which would result in distorted (too good) results.
9c04b02a20a2281a16be92d3747a0197e74fa03a9eac667c26d5624f9f434e10
['bc5d782f3f8c4064b1f268c55b497e03']
I want to run a script on a cluster ~200 times using srun commands in one sbatch script. Since executing the script takes some time it would be great to distribute the tasks evenly over the nodes in the cluster. Sadly, I have issues with that. Now, I created an example script ("hostname.sh") to test different parameters in the sbatch script: echo `date +%s` `hostname` sleep 10 This is my sbatch script: #SBATCH --ntasks=15 #SBATCH --cpus-per-task=16 for i in `seq 200`; do srun -n1 -N1 bash hostname.sh & done wait I would expect that hostname.sh is executed 200 times (for loop) but only 15 tasks running at the same time (--ntasks=15). Since my biggest node has 56 cores only three jobs should be able to run on this node at the same time (--cpus-per-task=16). From the ouptut of the script I can see that the first nine tasks are distributed over nine nodes from the cluster but all the other tasks (191!) are executed on one node at the same time. The whole sbatch script execution just took about 15 seconds. I think I misunderstand some of slurm's parameters but looking at the official documentation did not help me.
1767b7ea1cc501290322f7c46cb95b5d5beaddbb7c6e77d15250680690ee1ce6
['bc6a39f8fbed49caae2858657f98d682']
For everyone who has the same problem and needs a solution: i found it out myself. You must update to linux kernel 3.3.0 to get initial support for the cintiq 24HD. I found a guide how to install the new kernel without having it to compile yourself: This guide will help you install Linux 3.3 Kernel under Ubuntu 12.04/11.10 or older. For Ubuntu (i386 / 32-bit): Open the terminal and run the following commands: $ cd /tmp && wget -O linux-headers-3.3.0-030300_3.3.0_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/linux-headers-3.3.0-030300_3.3.0-030300.201203182135_all.deb $ sudo dpkg -i linux-headers-3.3.0-030300_3.3.0_all.deb $ cd /tmp && wget -O linux-headers-3.3.0-generic_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/linux-headers-3.3.0-030300-generic_3.3.0-030300.201203182135_i386.deb $ sudo dpkg -i linux-headers-3.3.0-generic_i386.deb $ cd /tmp && wget -O linux-image-3.3.0-generic_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/linux-image-3.3.0-030300-generic_3.3.0-030300.201203182135_i386.deb $ sudo dpkg -i linux-image-3.3.0-generic_i386.deb For Ubuntu (amd64 / 64-bit) $ cd /tmp && wget -O linux-headers-3.3.0-030300_3.3.0_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/linux-headers-3.3.0-030300_3.3.0-030300.201203182135_all.deb $ sudo dpkg -i linux-headers-3.3.0-030300_3.3.0_all.deb $ cd /tmp && wget -O linux-headers-3.3.0-generic_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/linux-headers-3.3.0-030300-generic_3.3.0-030300.201203182135_amd64.deb $ sudo dpkg -i linux-headers-3.3.0-generic_amd64.deb $ cd /tmp && wget -O linux-image-3.3.0-generic_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/linux-image-3.3.0-030300-generic_3.3.0-030300.201203182135_amd64.deb $ sudo dpkg -i linux-image-3.3.0-generic_amd64.deb After you finish, reboot your system $ sudo reboot To check updated Linux kernel $ uname -r The output will show you the upgraded kernel. WARNING Please upgrade the kernel at your own risk because it may render your system unstable. Additionally, upgrading kernel may cause problems with some installed proprietary drivers of NVIDIA / ATI (AMD) graphics cards, broadcom wireless etc., so be cautious! Now everything works the way it should be! =)
e96aefff93680c72176e76026e95080b2ab815cad1190140365d4c4922b7e972
['bc6a39f8fbed49caae2858657f98d682']
El error esta en el for for (int i = 0; i <palabras.length; i++) { if(palabraUsuario[i]==letra){ letraFinal[i]=letra; } } palabras.length retorna un valor de 5 (indice máximo 4) palabraUsuario es un char array de longitud 4 (indice máximo 3) por lo que al momento de llegar al indice 4 del arreglo palabras (en el for), en el if interno la validación palabraUsuario[i] (que seria palabraUsuario[4]) trata de acceder a una posición que no existe en el char array.
9739f968a354e62165135b7b070a56df739e4bf78288c0af54c6307945c591ac
['bc6da4a0d4e3404290e1ad8bdf01308f']
Everyone, I made a web application using Vue framework and it says to get a dist file before deployment which is done using : npm run build After building the dist file I put the whole application folder in my FileZilla. Now when I try to open the website it shows just the blank page. Does anyone know if I am missing any steps in Vue framework?
5a782b496ee80d8cadfbeda9580ef013e807a1651ec0898223117d095241c047
['bc6da4a0d4e3404290e1ad8bdf01308f']
Okay try this I am sure this will work: <!DOCTYPE html> <html lang="en"> <head> <title>Try This</title> </head> <body> <h1 id="fruit"></h1> <script> var fruits = ["bannanna", "apple", "orange", "grapes"]; var text = ""; var i; for (i = 0; i < fruits.length; i++) { text += fruits[i] + "<br>"; } document.getElementById("fruit").innerHTML = text; </script> </body> </html>
72eb66622f57b8e6d0ad04759afe9773c2024614ca1fdc83c95a35c4c220234f
['bc7d0d5ec4624f73a44433d3fd1277d5']
I am trying to access excel files through the django-admin model viewing portal. Each excel file is generated through a seperate algorithm, and is already in a directory called excel_stored each excel file is generated with an ID that corresponds to its model # in django. So it would be excel_%ID%.xlsx or excel_23.xlsx for example. I want my django FileField() to access the relevant excel file so that I can download it from my django admin portal, just like I can access my other model information (city name, time uploaded, etc). Here is a pseudo-code of what I'd want to do: My models.py would look like this excel = models.FileField() The process of saving would look like this create_excel() ### EXCEL WAS SAVED TO DIR: excel_stored ### save_excel = Model(excel = file.directory((os.path.join(BASE_DIR, 'lead/excel_stored/excel_%s.xlsx' %ID)) save_excel.save() Id then be able to download it like this https://i.stack.imgur.com/4HRUU.gif I know there's a lot I'm missing, but most documentation I find refers to uploading an excel file through forms, not accessing it. I've been stuck on this for a while, so I'd appreciate some direction! Thank you!
b1316bc4940e000393d5cab62da657c4f01511a7605b4586195461d291e95465
['bc7d0d5ec4624f73a44433d3fd1277d5']
Please ELI5 if possible, since i've only been coding for a few days and this is my first program! Below is a portion of my script that is supposed to interpret a single line of input that somebody enters (like "5+5" or something). I have other operations that I want to add later that are formatted differently, which is why I'm using string instead of a switch function or something. Anyways.. this isn't working :( So below is my logical process and maybe somebody can point out where I messed up? :) Thank you in advance! if (fork.find("+" && "-" && "x" && "/")) { size_t pos = fork.find("+" && "-" && "x" && "/"); // Defines a position at the operator symbol string afterfork = fork.substr(pos + 1); // Cuts a substring at the operator symbol + 1 size_t beforepos = fork.find_first_of(fork); // Defines a position at the beginning of the string string beforefork = fork.substr(beforepos); // cuts a substring at the begninning of the string string atfork = fork.substr(pos); // cuts a substring that only has one char (the operator +, -, x, etc) int x = stoi(beforefork.c_str()); // converts the first substring to an integer int y = stoi(afterfork.c_str()); // converts the third substring to an integer string operation = atfork; // converts the middle substring that only has one char to a different name. return input(x, operation, y); // will send this information to the input function (which will do the math for the calculator). }
e0a399bef7d3d47ff0c535f1fa77569ab8b0c3857667dfd9ce1c149b8aefe08b
['bc7e3b36764846d7a47530e51c6cfbaf']
Thank you all for your help! The following chunk solved the problem library(rvest) library(dplyr) library(httr) url <- "https://www1.folha.uol.com.br/poder/2020/01/folhas-da-manha-da-tarde-e-da-noite-se-uniram-sob-um-so-titulo-folha-de-spaulo-ha-60-anos.shtml" pagina.web <- iconv(readLines(url, encoding = 'UTF-8'), 'UTF-8', 'UTF-8', sub = '') titulo.noticia <- read_html(paste0(pagina.web, collapse = '\n')) %>% html_nodes('body') %>% html_nodes('main') %>% html_nodes('article') %>% html_nodes('.block') %>% html_nodes('h1') %>% html_text() titulo.noticia
b6530630ebf8cd5c5f7f58fe8d9bd98084b2291266347a79476ef680a67c8d5a
['bc7e3b36764846d7a47530e51c6cfbaf']
While I was web scraping links from a news site using Rvest tools, I often stumbled upon links that redirects to another links. In those cases, I could only scrape the first link, while the second link was the one that actually contained data. For example: library(dplyr) library(rvest) scraped.link <- "http://www1.folha.uol.com.br/folha/dinheiro/ult91u301428.shtml" article.title <- read_html(scraped.link) %>% html_nodes('body') %>% html_nodes('.span12.page-content') %>% html_nodes('article') %>% html_nodes('header') %>% html_nodes('h1') %>% html_text() article.title #> character(0) redirected.link <- "https://www1.folha.uol.com.br/mercado/2007/06/301428-banco-central-volta-a-intervir-no-mercado-para-deter-queda-do-cambio.shtml" article.title <- read_html(redirected.link) %>% html_nodes('body') %>% html_nodes('.span12.page-content') %>% html_nodes('article') %>% html_nodes('header') %>% html_nodes('h1') %>% html_text() article.title #> "Banco Central volta a intervir no mercado para deter queda do câmbio" Is there any way to obtain the second link using the first one? The website only retains the first one.
cc4d30eeda8de2d2c0563aa372332938e4a9e32cacdcce6b52483e640dc4b4e2
['bc8257d014064a01803d445adaa6ef8c']
Could it be that you are creating the Adapter before onCreateView completes? I had an issue where I had a function calling getView() and manipulating the the layout elements before onCreateView returned, causing the incorrect view to be used. I ended up sending the inflated view from onCreateView to the function, and it worked worked out fine.
2f1f91230d2aceaeeecf8dbc1e791a26a59fab80e9952197b477801fca1f681f
['bc8257d014064a01803d445adaa6ef8c']
After looking at this further, I have decided that the simplest method here is to just change the icon images. Instead of having key icons consisting of a number/background, The icons will just be numbers with transparent backgrounds and a separate, number-less background drawable will be used in place of the KeyboardView keyBackground.
dbe022c4fc7c4b3834a340cdb6e93152cfcd0adc49f5a0dc0c6b76d8915fe278
['bc8d8da6f0ba44858ff70765017622b1']
I have installed chrome on Kali Linux. But It doesn't run. After searching on the internet I found a solution in which you have to disable sandbox if you wanna run google chrome as a root user. According to my research sandbox is computer security box that prevents from executing malicious URL (correct me if I am wrong). So here's my question: I wonder is it safe to disable sandbox ?. if it is not safe so Is there any software like a sandbox to prevent malicious URL to execute ?. I like to use google chrome since the beginning and it is hard to switch to Firefox. I have never used Firefox. Note: this question is for all Linux distribution.if you know only about Kali Linux feel free to only answer on Kali Linux.
31efebacc76c82af9a23b110f2b410f95904692a5e55bb6ce8ec4b10c42850ec
['bc8d8da6f0ba44858ff70765017622b1']
I have a quite odd problem. At random times my dovecot daemon dies and I cannot receive/send emails while the host is still up. When trying to SSH into the server to see what happened, I discover that SSH is also dead. After a rebooting the server everything works. I have discovered the following: The problem is related somehow to cron.daily and rsyslog. By looking at several different syslog files I see the following behavior at the last lines of each syslog file: syslog.3: Jan 10 07:35:02 hostname anacron[11427]: Job `cron.daily' started Jan 10 07:35:02 hostname anacron[11584]: Updated timestamp for job `cron.daily' to 2014-01-10 Jan 10 07:35:03 hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1954" x-info="http://www.rsyslog.com"] rsyslogd was HUPed syslog.2: Jan 11 07:35:02 hostname anacron[788]: Job `cron.daily' started Jan 11 07:35:02 hostname anacron[901]: Updated timestamp for job `cron.daily' to 2014-01-11 Jan 11 07:35:02 hostname rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="1954" x-info="http://www.rsyslog.com"] rsyslogd was HUPed syslog.1 (when the processes hanged): Jan 12 07:35:01 hostname anacron[21678]: Job `cron.daily' started Jan 12 07:35:01 hostname anacron[21806]: Updated timestamp for job `cron.daily' to 2014-01-12 It seems that right before the problem rsyslogd was called but didn't run for some reason. Later the processes that tried to write to the syslog, such as dovecot and ssh, weren't able to do so and therefore hanged. Do you have any suggestions how to fix this problem? The system is running: Linux hostname 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux rsyslogd 5.8.11, compiled with: FEATURE_REGEXP: Yes FEATURE_LARGEFILE: No GSSAPI Kerberos 5 support: Yes FEATURE_DEBUG (debug build, slow code): No 32bit Atomic operations supported: Yes 64bit Atomic operations supported: Yes Runtime Instrumentation (slow code): No OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013 dovecot 2.1.7
63640d3f434f265c92461eea983294f5575727db514f58a0d732c702d8ee4ec8
['bc8f7c932fc545e4a643cf5ccafc3472']
Estou tentando setar algumas rotas filhas na minha aplicação angular 7 porém elas não funcionam, tenho o seguinte cenário: Possuo um base-home.component e um home.component, encapsulei os dois components em modules específicos de cada um, base-home.module e home.module, importei os dois módulos no app.module, e setei no app-routing.module umas rota '/' que chama o base-home.component, e uma rota filha '/home' que chama o home.component, porém ele não carrega a página, porém se eu importar os components direto no app.module em vez de importar os modules eles funciona, segue como estão os arquivos: // app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { HomeModule } from './home/home.module'; import { BaseHomeModule } from './base-home/base-home.module'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, CommonModule, AppRoutingModule, BaseHomeModule, HomeModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } // app-routing.module.ts import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { HomeComponent } from './home/home.component'; import { BaseHomeComponent } from './base-home/base-home.component'; const routes: Routes = [ { path: '', component: BaseHomeComponent, children: [ { path: 'home', component: HomeComponent } ] } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule { } // base-home.module.ts import { NgModule } from '@angular/core'; import { BaseHomeComponent } from './base-home.component'; @NgModule({ declarations: [ BaseHomeComponent ], exports: [ BaseHomeComponent ] }) export class BaseHomeModule {} // home.module.ts import { NgModule } from '@angular/core'; import { HomeComponent } from './home.component'; @NgModule({ declarations: [ HomeComponent ], exports: [ HomeComponent ] }) export class HomeModule { } Dessa maneira acima ele não funciona, mas se eu importar o base-home.component direto no no app.module ele funciona, dessa forma: // app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { HomeModule } from './home/home.module'; import { BaseHomeComponent } from './base-home/base-home.component'; @NgModule({ declarations: [ AppComponent, BaseHomeComponent ], imports: [ BrowserModule, CommonModule, AppRoutingModule, HomeModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } Alguém sabe como eu posso fazer as child routes funcionar importando apenas os modules com os components encapsulados sem precisar importar o component direto no app-module ?
a3647131183043ca227cee06ee425240f8c1992993bfac3dd864d1c6ebba4b8b
['bc8f7c932fc545e4a643cf5ccafc3472']
Thank you for the comment. I'm using the default front page display, with Blog module content set to "Promoted to front page". I checked the publication date and it looks fine. I'm not sure what else I can specify. It's basically Drupal showing blog posts on the front page but the very first one for some reason doesn't show up.
0daa3ec59f30188623fab6a238895e43151dd3021ca45b0f38d8a3fbeaa3c289
['bc9536360d9d48e294c83b8655fac33f']
If you need to do this operation in a time critical region, the following code is the fastest (using Numpy 1.9 development version): In [1]: A = numpy.array([1, 2, 3, 4, 5]*1000) In [2]: %timeit numpy.array([A, A]).T.ravel('F') 100000 loops, best of 3: 6.44 µs per loop Note that flatten would make an additional copy, so ravel should be used instead. If you prefer readability, the column_stack and repeat functions are better: In [3]: %timeit numpy.column_stack((A, A)).ravel() 100000 loops, best of 3: 15.4 µs per loop In [4]: timeit numpy.repeat(A, 2) 10000 loops, best of 3: 53.9 µs per loop
2a99efe19a34267fa58d73bf5bea39c0e1b591fcc4953a301080944aafe40adf
['bc9536360d9d48e294c83b8655fac33f']
What is the simplest way to create a pxd definition file, which simply collects cdefs replicated over pyx files, without creating new extensions? My case is the following: I would like to gather some extern cdefs in a pxd file (hp/src/common.pxd). I've also added some non-extern cdef, whose implementation is in common.pyx. In another pyx file (hp/src/_lib.pyx), which I turn into an extension, I cimport some stuff from common. In the setup.py file I create the following extension: Extension('hp._lib', ['hp/src/_lib.pyx'], language='c++'), By doing so, no common.cpp file is created, so it looks like dependencies are not automatically handled. That's the first problem. Then, manually running 'cython --cplus common.pyx' correctly creates a common.cpp file in the directory hp/src, and if I add 'hp/src/common.cpp' to the list of the extension sources, the command python setup.py installs everything without complaint, but then, importing the module hp triggers an ImportError: No module named common... from _lib.cpp... I'm stuck here. Any idea?
9a733c1567975f1653136b6d50d6af19456a4d696e35b2b0d33eebae5edb007a
['bc9a4846e74249a0abfdf111087de130']
I have a list of items with buy prices ranging from $0.5 to $3000 and quantities can be bought from 0.5 a unit to thousands of units. Here is an What's wrong with the data? P&L Percentage This is the profit and loss percentage, the P & L Column is showing a profit however P & L Column is showing a loss. The Formula used to Calculate P & L =(E3/D3-C3/B3)*D3 The Formula used to Calculate P&L Percentage - A note this is formula used to calculate total percentage NOT row wise =(SUM(Sell_Costs_Proceeds)/Sum(Sell_Base_Qty)-sum(Buy_Costs_Proceeds)/sum(Buy_Base_Qty))/(sum(Buy_Costs_Proceeds)/sum(Buy_Base_Qty)) The percentage should obviously be in postive. Some key points: Buy and Sell Numbers can be different so profit is accordingly calculated. quantity has a huge disparity some quantities are less in 1 (0.2) and some thousands (17237). Cost is the same some costs are very high and some low. Here is the link for the sheet
299a838657cb81f6c6e46cbdc3fe9b0adad428079833f74e33d9421d4ee6036b
['bc9a4846e74249a0abfdf111087de130']
If you saw a Pi (π) I have to ask: Do you suffer migraines? Do you have this little neighborhood kid who annoys you asking you for complex calculations (complex for regular stupid people, of course)? If the answer on both is a Yes, I'll ask you to throw that electric drill you must have hidden somewhere.
768c4074a7baf2c37fa6bad0f79a13d9af71a912db4250167dd8c825f5cec00a
['bc9b9d9ed974409e99bfc5f69b541299']
I achieved this using layout xml code as follows: <TextView android:id="@+id/about_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:textAppearanceMedium" /> <TextView android:id="@+id/readme_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/changelog_text" /> <WebView android:id="@+id/readme_content" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="2" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbars="vertical" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:layout_gravity="center_horizontal" android:orientation="horizontal"> <FrameLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_weight="0.5" /> <cu.tellistico.ImageButtonText android:id="@+id/btn_gift" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:contentDescription="@string/btn_donate_info" custom:buttonBackground="@drawable/states_orange" android:src="@drawable/ic_gift" android:text="Donar" android:textColor="@color/text_orange" /> <FrameLayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_weight="0.5"/> </LinearLayout> </LinearLayout> Below the blue text there is a scrollable Webview, and a button footer. Is this valid for you?
c3fee45fc9726e3bcb2d60723cf78e51527a3e4435e5f9aa68d0e07d7b9cb82c
['bc9b9d9ed974409e99bfc5f69b541299']
I am on development of my first game. The mechanics is simple: pop bubbles that move randomly on screen. My canvas is a RelativeLayout over Activity. The layout is simple. <RelativeLayout android:id="@+id/frame" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/header" /> The touch event is defined by implementing onTouch method from View.OnTouchListener. A class extract follows: public class BubbleActivity extends AppCompatActivity implements View.OnTouchListener { private RelativeLayout mFrame; @Override public boolean onTouch(View v, MotionEvent event) { //... } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //... setContentView(R.layout.activity_bubble); mFrame = (RelativeLayout) findViewById(R.id.frame); //... } @Override protected void onResume() { super.onResume(); mFrame.setOnTouchListener(this); } } The problem is that sometimes touch event doesn't occurs. I am wondering if there is some kind of mechanism for grab the focus always, ensuring the touch event in my RelativeLayout object. Any help is welcome
d6df35e4413e040d6b8d978e00958c7c912487c5e1a712cd8bc11b38f101a43c
['bca8215363c946028a05fc4ca47de77b']
<PERSON> I'd disagree. Making a code interface designed for usability has nothing to do with YANGI. I can code a good UI or a bad one that does or does not have unused methods, there is no causal relationship here. Having unused/redundant methods, in fact, is bad interface design because it's confusing to the programmer using your interface.
46d97db2809f1f82df97878a851e7614a80f13622bf0d4b689d41655251616b8
['bca8215363c946028a05fc4ca47de77b']
Just say you are a Druid. Say it seriously. Don't tell her like it is a big deal. Just say it matter-of-factly when she or some other person assumes wrongly. I know how it feels like when religion gets assumed as a family trait. If you explain your religion to anyone, don't say it like it is a big deal. Wikipedia page says your religion focuses on nature, so just say my religion involves respecting nature or something more; after all you know it more than I do. If you want to be taken seriously, then you won't want to convert people or explain them unnecessarily. If your mother still asks you to follow rituals of Christianity, let it not be a clash of egos or religions; she expected you to be this way. There are numerous innocuous rituals that are performed and that reflect our society more than any single religion. Keep it in mind. If there is something about Christianity that puts you off, you can already say not to be forced into it. There is good and bad. You can choose any part of any religion to follow since there is no particular guide to follow. Keep in mind that religions don't make us; we make them. So you can be Christian and Druid at the same time. I am neither really and am agnostic. Yet it means that to have a Hindu mother in India means to visit temples when you are expected to. One has to pick their battles!
5a0b7620fd53108610ca7b07929d10c135b8062194dfce8007f5bedc5dc2877a
['bcac0df1c2da4a3bbe31edfaed887398']
This is my code : package twitter; import twitter4j.PagableResponseList; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.TwitterFactory; import twitter4j.User; import twitter4j.auth.AccessToken; import twitter4j.conf.ConfigurationBuilder; public class getFollowersIds { public static final String CONSUMER_KEY = "PRIVATE"; public static final String CONSUMER_SECRET = "PRIVATE"; public static final String USER_ID = "PRIVATE"; public static final String ACCESS_TOKEN = "PRIVATE"; public static final String ACCESS_TOKEN_SECRET = "PRIVATE"; public static final int CURSOR = -1; public static void main(String[] args) { Twitter twitter = new TwitterFactory().getInstance(); twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); AccessToken oathAccessToken = new AccessToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET); twitter.setOAuthAccessToken(oathAccessToken); try { PagableResponseList<User> users = twitter.getFriendsList(USER_ID, -1); User user = null; for (int i = 0 ; i < users.size() ; i++){ user = users.get(i); System.out.println("Following: "+users.size()); System.out.print("\nID: "+user.getId()+" / User: "+user.getName()+" /"); System.out.print("\nFollowers: "+user.getFollowersCount()+"\n"); } } catch (TwitterException e) { e.printStackTrace(); } } } And this is the error lines : Relevant discussions can be found on the Internet at: http://www.google.co.jp/search?q=7e95ed42 or http://www.google.co.jp/search?q=45f34518 TwitterException{exceptionCode=[7e95ed42-45f34518], statusCode=404, message=Sorry, that page does not exist, code=34, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=14, limit=15, resetTimeInSeconds=1411644615, secondsUntilReset=710}, version=4.0.2} at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:163) at twitter4j.HttpClientBase.request(HttpClientBase.java:53) at twitter4j.HttpClientBase.get(HttpClientBase.java:71) at twitter4j.TwitterImpl.get(TwitterImpl.java:1538) at twitter4j.TwitterImpl.getFriendsList(TwitterImpl.java:479) at twitter4j.TwitterImpl.getFriendsList(TwitterImpl.java:474) at twitter.getFollowersIds.main(getFollowersIds.java:38) Need help pls Don't know what happens ... Error in > PagableResponseList users = twitter.getFriendsList(USER_ID, -1); Thanks ThanksthanksthanksthanksthanksThanksthanksthanksthanksthanksThanksthanksthanksthanksthanksThanksthanksthanksthanksthanksThanksthanksthanksthanksthanks
b69ac4a9d6664a9994a6b3566ab6ada05b0983f5a7a28d661a57e90e9a991e56
['bcac0df1c2da4a3bbe31edfaed887398']
I have the index.php file, where I have this code that, when in html code you press button, it sends you to insert data in MySQL database. $app->post('/nuevo', function() use($app, $db){ $request = $app->request; $nombre = $request->post('Nombre'); $apellidos = $request->post('Apellidos'); $nifcode = $request->post('NIF'); $direccion = $request->post('Direccion'); $email = $request->post('Email'); $telefono = $request->post('Telefono'); $estado = $request->post('Estado'); $dbquery = $db->prepare("INSERT INTO ClientesSinHechos(Nombre, Apellidos, NIF, Direccion, Email, Telefono, Estado) VALUES(:Nombre, :Apellidos, :NIF, :Direccion, :Email, :Telefono, :Estado)"); $res = $dbquery -> execute(array(':nombre' => $nombre, ':Apellidos' => $apellidos , ':NIF' => $nifcode, ':Direccion' => $direccion, ':Email' => $email , ':Telefono' => $telefono, ':Estado' => $estado)); $app->redirect('ClientesSinHechos'); }); This is inside the index.php, and in my register html page, I have this part : <div class="container"> <form action="" method="POST" role="form"> <br /> <h3><b>Datos de cliente : </b></h3> <p><br /> <table width="42%"> <tr> <div> <label for="Nombre">Nombre : </label> <input width="50" type="text" class="form-control" id="Nombre" name="Nombre" placeholder="Introduce nombre"> </div> </tr> <p><br /> <tr> <div> <label for="Apellidos">Apellidos : </label> <input width="50" type="text" class="form-control" id="Apellidos" name="Apellidos" placeholder="Introduce apellidos"> </div> </tr> <p><br /> <tr> <div> <label for="NIF">NIF : </label> <input width="50" type="text" class="form-control" id="NIF" name="NIF" placeholder="Introduce NIF"> </div> </tr> <!--<p><br /> <tr> <div> <label for="Fecha_Nacimiento">Fecha de nacimiento : </label> <form name="fcalen"> <INPUT name="fecha1" size="10"> <input type=button value="Seleccionar fecha" onclick="muestraCalendario('','fcalen','fecha1')"> </form> </div> </tr>--> <p><br /> <tr> <div> <label for="Direccion">Dirección : </label> <input width="50" type="text" class="form-control" id="direccion" name="direccion" placeholder="Introduce dirección"> </div> </tr> <p><br /> <tr> <div> <label for="Email">Dirección de <PERSON> : </label> <input width="50" type="text" class="form-control" id="email" name="email" placeholder="Introduce <PERSON>"> </div> </tr> <p><br /> <tr> <div> <label for="Telefono">Teléfono : </label> <input width="50" type="text" class="form-control" id="telefono" name="telefono" placeholder="Introduce teléfono"> </div> </tr> <p><br /> <tr> <div> <label for="Estado">Estado : </label> <input width="50" type="text" class="form-control" id="estado" name="estado" placeholder="Introduce un estado"> </div> </tr> <p><br /> <button type="submit" class="btn btn-primary">Registrar</button> </table> </form> </div> The console throws me this : Details Type: ErrorException Code: 2 Message: PDOStatement<IP_ADDRESS>execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined File: /var/www/slimtest/index.php Line: 44 That line is this one : , ':Telefono' => $telefono, ':Estado' => $estado)); Help thanks.
297e8716598ef32974259471fff6b35d4eabec11c4422db9eec371268e04d14e
['bccaf3d53bb14bb1a454bf106a20b0fe']
You can collect your data first, and print it in a separate loop. This makes grouping easier. In your example: Replace this line: <p><?php echo $terms[1]->name; ?>, <?php echo $terms[0]->name; ?></p> with <?php $my_output[$terms[1]->name][] = $terms[0]->name; ?> to collect the data in a multidimensional array. And at the very end put: <?php foreach($my_output as $key => $values): ?> <p><?php echo $key; ?>, <?php echo implode(',', $values); ?></p> <?php endforeach;?> to print all of it. Check the manual for the implode function I used. For best practices you should initialize $my_output = array() somewhere at the beginning (before the first foreach).
ee092725fa2384d6c9ad68b6fc20aed02db5ba70e393727707e89b330e8e957d
['bccaf3d53bb14bb1a454bf106a20b0fe']
You need to remove your action from your own query. Otherwise your function will call itself recursively, and exhaust the memory due to infinite recursion. This should do the trick: // remove our action temporarily remove_action('pre_get_posts','exclude_pages_from_search'); $hidePages = new WP_Query( array ( ... //your query $hidePageIds = implode( ',', $hidePages->posts ); // add the action again add_action('pre_get_posts','exclude_pages_from_search'); if ... //rest of your function
fc61b0b9c481ff7e04dd06c1a842c7454bbf5b167415b40c360e03da90f9cc3f
['bcced17e1edd4d909999dc1e2bfbbf8f']
I have some points in my table in mysql . this point is saved in column grid (number) the position in grid in html. i do 2 loop for when i found the points the square be in color blue else i put the square in red but when i change the resolution of navigator the grid change and the point also and it position may be the grid is not responsive. for (i = 0; i <= 930; i++) { ("#displaygrille").append('<div class="ui-block-a cell onCellClick" id="' + i + '">'); $.each(res, function (k, v) { if(i == v.grille){ console.log("Grille " + i + " = " + v.grille + " trouvée"); $("#"+i).removeClass("onCellClick"); $("#"+i).html(''); $("#"+i).append('<div class="alveole-vide" ></div>'); if( v.nb_cables > 0 ){ $("#"+i).html(''); $("#"+i).append('<div class="alveole-oqp"></div>'); } if( v.reservation == "true" ){ $("#"+i).html(''); if( v.nb_cables > 0 ){ $("#"+i).append('<div class="alveole-oqp"><div class="alveole-reza"></div></div>'); }else{ $("#"+i).append('<div class="alveole-vide"><div class="alveole-reza"></div></div>'); } } if( (v.nb_cables == 0) && (v.reservation == "false")){ $("#"+i).html(''); $("#"+i).append('<div class="alveole-vide" ></div>'); } } }); $("#displaygrille").append('</div>'); } i work with php mysql Jquery mobile. any help plz
023216f0c550d67b50156f6e4c09257d8ad0b4ed17f172fa23855d73c384ed0a
['bcced17e1edd4d909999dc1e2bfbbf8f']
i have a list of personal loaded in page when i click to an element of the list i display it information ; the click run very well but when i click in a button to filter this list for example to display in this list the developer personal the click to display information does not fire. i forgot to tell you i have done this $("ul").on("click", "li a", function() { console.log("clicked"); }); but still not working <ul class="mail-list"> <li class="mail-list-item"> <a class="mail-list-link" href="#show"> <div class="mail-list-name">John</div> <div class="mail-list-content"> <span class="mail-list-subject">Developer</span> </div> </a> </li> <li class="mail-list-item"> <a class="mail-list-link" href="#show"> <div class="mail-list-name">Mike</div> <div class="mail-list-content"> <span class="mail-list-subject">Designer</span> </div> </a> </li> </ul> javascript 'use strict'; (function ($) { 'use strict'; var Mail = { Constants: { MEDIA_QUERY_BREAKPOINT: '992px' }, CssClasses: { MAIL_LIST: 'mail-list', MAIL_LIST_ITEM: 'mail-list-item', MAIL_LIST_LINK: 'mail-list-link', MAIL_CONTENT: 'mail-content', ACTIVE: 'active', HOVER: 'hover' }, init: function init() { this.$window = $(window); this.$list = $('.' + this.CssClasses.MAIL_LIST); this.$items = $('.' + this.CssClasses.MAIL_LIST_ITEM); this.$links = $('.' + this.CssClasses.MAIL_LIST_LINK); this.$content = $('.' + this.CssClasses.MAIL_CONTENT); this.$backBtns = this.$content.find('[data-toggle="tab"]'); this.breakpoint = null; this.bindEvents(); }, bindEvents: function bindEvents() { this.$items.on('mouseenter.e.mail', this.handleItemMouseEnter.bind(this)); this.$items.on('mouseleave.e.mail', this.handleItemMouseLeave.bind(this)); this.$links.on('click.e.mail', this.handleLinkClick.bind(this)); this.$links.add(this.$backBtns).on('shown.bs.tab', this.handleTabShown.bind(this)); $("ul").on("click", "li a", function() { console.log("clicked"); }); this.breakpoint = window.matchMedia('(max-width: ' + this.Constants.MEDIA_QUERY_BREAKPOINT + ')'); this.breakpoint.addListener(this.handleMediaQueryChange.bind(this)); }, handleItemMouseEnter: function handleItemMouseEnter(evt) { $(evt.currentTarget).addClass(this.CssClasses.HOVER); }, handleItemMouseLeave: function handleItemMouseLeave(evt) { $(evt.currentTarget).removeClass(this.CssClasses.HOVER); }, handleLinkClick: function handleLinkClick(evt) { var $link = $(evt.currentTarget), $item = $link.closest('.' + this.CssClasses.MAIL_LIST_ITEM); if ($item.hasClass(this.CssClasses.ACTIVE)) $item.removeClass(this.CssClasses.ACTIVE); this.rememberScrollbarPos(); }, handleTabShown: function handleTabShown(evt) { var $trigger = $(evt.currentTarget), $activeLink = this.getActiveLink(); if (!$trigger.is($activeLink)) { this.scrollTo(this.rememberedScrollbarPos()); } else { this.scrollTo(0); } }, handleMediaQueryChange: function handleMediaQueryChange(evt) { var $target = this[this.mediaQueryMatches() ? 'getBackBtn' : 'getActiveLink'](); $target.length && $target.trigger('click'); }, mediaQueryMatches: function mediaQueryMatches() { return this.breakpoint.matches; }, rememberScrollbarPos: function rememberScrollbarPos() { this.ypos = this.$window.scrollTop(); }, rememberedScrollbarPos: function rememberedScrollbarPos() { return this.ypos; }, getActiveItem: function getActiveItem() { return this.$items.filter('.' + this.CssClasses.ACTIVE); }, getActiveMail: function getActiveMail() { return this.$content.filter('.' + this.CssClasses.ACTIVE); }, getActiveLink: function getActiveLink() { var $activeItem = this.getActiveItem(); return $activeItem.find('[data-toggle="tab"]'); }, getBackBtn: function getBackBtn() { var $activeMail = this.getActiveMail(); return $activeMail.find('[data-toggle="tab"]'); }, scrollTo: function scrollTo(ypos) { this.$window.scrollTop(ypos); } }; Mail.init(); })(jQuery);
6eb06b41aa1ba5b030762f88a85441d345e5f9c7c813f80fc516b811ea9b549b
['bcd0cd70875044aab9f62a730517b28f']
Consider any $3\times 3$ real symmetric matrix $H^T=H$. Find a $2\times 2$ orthogonal matrix $P^T=P^{-1}$, a $2\times 1$ vector $\mathbf{u}$ and a nonzero constant $t$ such that the matrix $$\begin{pmatrix} P & \mathbf{0} \\ \mathbf{u}^T & t\end{pmatrix} H \begin{pmatrix} P & \mathbf{u} \\ \mathbf{0}^T & t\end{pmatrix}$$ has eigenvalues in the set $\{\pm 1\}$. I still don't see how to solve it.
efa6d46f83bffe3c910e9a34a13526e2c2a1ed1796644f33fb2d166fc65a4573
['bcd0cd70875044aab9f62a730517b28f']
I'm in the same boat and have been struggling with this! I managed to get my build working by adding the following to the command line args: -workspace [Name.xcworkspace] -Scheme [NameOfScheme] I also had to edit the scheme and add the Pods target explicitly as it was failing the build with Library not found for -lPods.
2175273ba668952b694a6fd1fa490c175a872dc8cf80fadbea02f4d22d381af7
['bcdf397220bc40fc8f9586ddc4c9410f']
<PERSON>, thank you for editing this! <PERSON>, sure, that would work. My point is there is much faster, less painful "fix" forcing Windows to correctly recognize the drive. It seems like OS too much in a hurry, that it doesn't wait for a user to fully plug in a device. That happens for other USB devices too, sometimes. Why no one has addressed it to Microsoft is beyond me...
c0942db738d471451a9257c4d5c82642b2b13f595dc5ff71e098a0f780399461
['bcdf397220bc40fc8f9586ddc4c9410f']
try to paste here the output from `tail VirtualBox\ VMs/Windows\ XP\ (Service\ Pack\ 3)/Logs/VBox.log`, you can also try to download another ISO (like ubuntu) because maybe your Windows ISO is broken, and try to update the VirtualBox with `sudo apt-get update && sudo apt-get upgrade -y virtualbox`
4554ba3039e450c24e107b330d5861b66ffcbfbc4654ba7ea413ff8693141c21
['bcf78b791ff34285969e0ae7cdd66fca']
First of all, I think <PERSON>'s Sticky Footer is great. Very compatible easy to implement. It's here if you haven't seen/heard of it before http://ryanfait.com/html5-sticky-footer/ * { margin: 0; } html, body { height: 100%; } .wrapper { min-height: 100%; margin: 0 auto -155px; /* the bottom margin is the negative value of the footer's height */ } footer, .push { height: 155px; /* '.push' must be the same height as 'footer' */ } /* Sticky Footer by <PERSON> http://ryanfait.com/ */ My issue though is. I've implemented it and great it's working, but on my mobile browser there's a bug. With <PERSON>'s Sticky Footer implemented the mobile browser url bar doesn't auto-hide when I scroll down, it just stays there, taking up valuable space. Not good. So I've narrowed this down to the 100% body height. When I remove that, the mobile browser url bar hides. Great. But the footer isn't sticky. Has anyone come across this before? Is there a fix? Or have is <PERSON>'s Sticky Footer now flawed :(
47b3e5829eb6f66578fa93ef3497d98413a20831d67c076c986f477309bbe105
['bcf78b791ff34285969e0ae7cdd66fca']
I'm using the following regex to build my urls as follows: ...templates/file url(r'^(?P<slug>[\w-]+)/$', views.template_type, name="template"), url(r'^(?P<template>[\w-]+)/(?P<slug>[\w-]+)/$', views.template_file, name="file"), The first line in here works fine pulling the slug field from the template model. It's the second line where I have the problem. In the second line the slug is pulled from a File Model field template is pulled from a Foreign Key field in the File Model of the Template Model Although everything is working almost fine. The Foreign Key pulls the title rather than the slug from the Template Model making the url case insensitive. eg website.com/template - works fine but then goes to website.com/Template/file that also works, but if a user deleted the file from the url to try to go back to website.com/Template they would get a 404 error. I hope that makes sense. I've tried making the urls case insensitive with (?i) but that has not worked. Thanks
86036e94773a2d7e4b5635e7621758ef4a92bce87d4ebd4d57185dcf5ac81472
['bd0d3a50aae048feab6c04807fe651fe']
I have a faulty phone wall socket which I think needs replacing. I am not very familiar with this type of technology so I don't know what I need. I have attached a pic of the one I have now. The problem is that the wire going into it doesn't click in to place, it sort of comes back out naturally. It was held in by a big wooden speaker but that no longer seems to work. I can get a dial tone if I push it in with all my force but that's not really a suitable solution. Any help is much appreciated.
07ef7f8e87be9f6f5427938a66a989192ddf0de80770a2add5075cda1f901407
['bd0d3a50aae048feab6c04807fe651fe']
In the U.S. context, I am wondering how colleges deal with the accommodation of students with disabilities when testing something for which "time is of the essence". Consider, for example, a sight-reading exam at a music school. Surely, as much as dyslexia seriously impairs reading text, there must exist an equivalent condition impairing some people's ability to read music. So I would expect that under current policies, a student who can demonstrate a serious "music reading disability" could ask for accommodation in the form of extra time on a sight-reading exam (at least if the exam is one where students are given some time with the new sheet before they have to perform it live)? The issue, obviously, is that time is of the essence in a sight-reading exam. What is being tested is precisely whether the student is able to quickly (sometimes even "on the spot") read a new sheet of music. Of course, this extends beyond the particular example of sight-reading. A school that trains mechanics may specifically want to test whether its students are able to service a car in a given amount of time. A school that trains chemists may want to test whether its students can perform a given experiment in a given amount of time as well. And so on and so forth. These situations seem hard to reconcile with requests for extra-time from students with disabilities. My questions are: Do current accommodation policies recognize a "special kind of tests" where "time is of the essence" and requests for extra time from students with disabilities can legally be turned down? If so, what prevents teachers from deciding that time is of the essence in all (or most) of their tests? In answers to other questions about extra time, we often read that "tests should test knowledge and understanding, not speed". What if a school decided it wanted to grant degrees to student who not only "understand" some material, but are also "quick on their feet" and able to apply this material to solve problems (or produce an artistic performance in the musical example above) in a timely manner? Could the school go down that road without contravening existing anti-discrimination regulations and risk losing all its public funding?
b6b6acf31ea50eb19cc5c8bbb7dacbdeddc657c5467eeca7a3bc24290c60f889
['bd0f50c6f7d94ce5baf93df488aaf600']
Well, in that case, the following might be enough. In a Longest Shortest Time (parenting podcast) episode, a professional clown who is also a dad shared a trick he used during potty training. Knowing that his son favors blue and dislikes green, he put a blue potty and a green potty in the play room. When he knows it's about time to pee, he pushes the green potty, and his son indignantly chooses the blue potty.
0fdac3ce32fd40e9109958385b56f098e64cf17731577677bf02b019f5ce2400
['bd0f50c6f7d94ce5baf93df488aaf600']
Move parameter to View-Model and use custom bindings. So You will have no problem with it. Look for this example that were born while I discuss this question with my college some time ago. Demo - http://jsbin.com/epojol/5 Code with preview - http://jsbin.com/epojol/5/edit#javascript,html,live Custom binding from demo: ko.bindingHandlers.rangeVisible = { update: function (element, valueAccessor, allBindings) { var selectedValue = ko.utils.unwrapObservable(valueAccessor()); var itemRange = allBindings().range; if (selectedValue < itemRange.max && selectedValue >= itemRange.min) $(element).show("slow"); else $(element).hide("slow"); } }; Binding in html: <div class="plan red" data-bind="rangeVisible: selected, range: {min: 0, max:10}">
f89c1272f684d1cdf2723a7380e8383582cf38d7490d40c2a3d407c2a19741f0
['bd10213843844890b26f07f0154f538f']
this is my code for in php file from which i recall a refresh php again nd again its working fine but now i have $id which i get while performing some query now i want to send it refresh.php page where some query will be performed then i get result back as return function repeatAjax(){ var arrPoints; $.ajax({ url: 'refresh.php', cache: false, success: function(result) { if(result){ var resultJson = $.parseJSON(result); refresh_point(resultJson["latitude"],resultJson["longitude"]); } } }); } this is my refresh.php page <?php $hostname_localhost ="localhost"; $database_localhost ="map"; $username_localhost ="root"; $password_localhost =""; $localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database_localhost, $localhost); //i want $id here so i can use it instead of 6 $query_search1 = "SELECT lat ,lng FROM van WHERE id =6"; $query_exec2 = mysql_query($query_search1) or die(mysql_error()); $row = mysql_fetch_assoc($query_exec2); $row1= $row['lat']; $row2= $row['lng']; $advert = array( 'latitude' => $row['lat'], 'longitude' => $row['lng'], ); echo json_encode($advert); ?> code is working awesome if i don't want to send some thing to refresh php if i just type id 6 i get the return OK fine but i want to post some thing but how ??
f71f2848c29fae21a5292af99d9bd0e3757680173aaef651fe1d9ebe4480e477
['bd10213843844890b26f07f0154f538f']
To get first day and last day of month $date = '2018-01-11'; // First day with 00:00:00 echo date('Y-m-01 00:00:00', strtotime($date )); echo '<br>'; // Last day with 00:00:00 echo date('Y-m-t 00:00:00', strtotime($date )); Output: 2018-01-01 00:00:00 2018-01-31 00:00:00
4a7d2ac423290137043434674cb5e8b602f2a413b10ca2abdf514bdf8e537978
['bd240db546d7430a81a1c703628d9b92']
I'm in the process of redesigning some application security log tables (things like when users log in, access different files, etc.) to address some changing requirements. They were originally made with MyISAM, but don't really get accessed that often and switching to InnoDB and adding a bunch of foreign keys for data integrity would really be more beneficial. Since I have to remake the tables anyway, I figure this is as good a time as ever to make the switch. For the most part, everything is straightforward foreign keys and works as expected. The only part that where I'm trying something weird and hitting problems is with user_ids. Each record in these log tables is associated with a user_id, and I want to make sure the given user_id exists when a record is inserted. Adding a foreign key that references the user table solves that problem - simple stuff. Here are some concise, representative tables: The User Table CREATE TABLE tbl_user ( id INT(10) NOT NULL AUTO_INCREMENT, first_name VARCHAR(50), PRIMARY KEY(id) ) ENGINE=InnoDB; Example Log Table CREATE TABLE tbl_login_time ( id INT(10) NOT NULL AUTO_INCREMENT, user_id INT(10) NOT NULL, login_at TIMESTAMP NOT NULL, PRIMARY KEY(id), CONSTRAINT 'tbl_login_time_fk_1` FOREIGN KEY (user_id) REFERENCES tbl_user ON UPDATE CASCADE ON DELETE ??? ) ENGINE=InnoDB; My problem is that I want the foreign key enforced for inserts, updates to be cascaded, but deleting records in tbl_user to not affect tbl_login_time at all. Normally users get marked as inactive, but every once in awhile a user gets deleted entirely yet the logs need to be maintained. The MySQL docs lists 6 options for ON DELETE, and none of them sound appropriate: RESTRICT: Would prevent the deletion in tbl_user. NO ACTION: Gets evaluated just like RESTRICT. CASCADE: Would delete in tbl_user like I want, but also in tbl_login_time. SET NULL: Would delete in tbl_user, and leave the row in tbl_login_time but nulls out the data. Close but no cigar. SET DEFAULT: MySQL recognizes it, but rejects it. Omit ON DELETE: Equivalent to RESTRICT. I've never used a foreign key like this before (enforce INSERT and UPDATE but not DELETE), and after reading a lot of other questions it doesn't seem like anyone else does either. That should probably tell me this is the wrong approach, but can it work somehow?
f0d93614911803b1c59d0eda2856be28743b5000f1c2a155653a16dc5a17a1cf
['bd240db546d7430a81a1c703628d9b92']
The problem is that BigInteger.pow() takes an int and not a BigInteger. Since b is a BigInteger you could do something like: BigInteger input4 = a.pow(b.intValue()).mod(n); but that will break if b is bigger than an int. Your best bet is to use BigInteger.modPow() instead since that takes 2 BigIntegers. Then you end up with: BigInteger input4 = a.modPow(b, n);
3bc144b10bbe1a967e335485f8ace42b213b61ac5711ed0e76154246754a431b
['bd249428abbb446f8d07973c57bea9e6']
My OpenVZ (debian) host environment has only the minimal packages installed. Now I was irritated to see a mysqld process in top when the mysql package is installed and running only in one container. So I killed it and saw the service down in the container. I can start it there again and everything is fine. But - was it not the idea of a virtual environment to separate the OS instances and their processes between host and clients?
874c1a6fae9849011aea95477f224c541e41024762e1e25d6269e0fabd4fd01b
['bd249428abbb446f8d07973c57bea9e6']
Given that you've tagged this with django-admin, I'll assume you're wishing to save the User who is modifying the object via the admin interface. (You can't really do it in your model's save method, because it doesn't necessarily have access to a User object -- e.g. what if you're saving an object from a shell interface?) To do this within Django's admin, simply override the save_model method of your ModelAdmin: class PostAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change): obj.user = request.user obj.save() admin.site.register(Post, PostAdmin) Of course, you would need to actually add a ForeignKey named user to your model for that to work...
cdf3ada50ee5c4b6cabb7818e576f200581e76d88cdf34006ea87100e49e3b7c
['bd25ef3dd90a46fda8f06d5317d803fb']
You could write your axaj call's success function to build the DOM elements from the json, then insert them in your form. But I think an easier solution is to send your ArticleController<IP_ADDRESS>editcategory() data ($articlecat_data) to an element that will render the form elements you need. Return this HTML to your ajax success function and have that function insert it into your form. All the normal cake form conventions will be honored in this way and the post data later will be just what you need. A little attention to the id and class attributes in both your original page and your ajax-returned snippet should make it easy to either swap out the whole form, just its inner-html or to add more inputs to the existing form. So my specific answer to "CAN I USE CAKEPHP FORMHELPER TO DO SO" is yes.
0483ae2c2e5526f23795af761b9979ac7d480611c6233d463205aeccb24af971
['bd25ef3dd90a46fda8f06d5317d803fb']
You can actually create new widgits—or any new DOM nodes—using javascript. Consider this jQuery snippet for a random project I have laying around: $(this).replaceWith( '<a class="remove" id="' + $(this).attr('id') + '" href="' + webroot + 'shop/remove/' + $(this).attr('id') + '" title="Remove item">' + '<img src="' + webroot + 'img/icon-remove.gif" alt="Remove" />' + '</a>' ); You can easily get a reference to your second form: $('form#id_of_form') But still, I find all this fussing around in jQuery and javascript a bit tedious for building a populated form when Cake is just an ajax call away. So your success function can be something like $('form#id_of_form').replaceWith(new_form_from_ajax_call);
7ac7f25e90b140c917daa9b60061f255852bc4eb0f587ca33678ae673972f128
['bd3065549f9a4204a0db61a143a50fdb']
I don't fully understand what you want to do, but I assume that you want to run those queries in loop and wait until all finish and then log results. If those queries need to be run in sequence. async function runQueries() { for (const item of jsonObj) { item.procesa = await data_mysql.vertodo(item); } } runQueries.then(function () { jsonObj.forEach(function (item) { console.log(item.procesa); }); });
e117699b2600c51d955ed7a2a7c472a90f3d1912fed9b1c0f18d060386527eb6
['bd3065549f9a4204a0db61a143a50fdb']
You can achieve that by using Custom Callback in passport.authenticate(). router.post('/login', async function(req, res, next) { passport.authenticate('local', function(err, user, info) { if (err || !user) { return res.redirect('/login'); } const devices = await Device.find({ owner: user._id }); if (!devices.length) { res.render('store', { title: 'Store' }); } else { res.render('devices', { title: 'My Devices', devices }); } })(req, res, next); });
8cda9dc89cc723aa22e2c473432db9893a7b99ff81f9d22ba04b11b2bef60d3d
['bd38d12870774f3dbb0e5852c121a365']
You can replace any starts of the input that is followed by two straight digits in this manner: String[] input = { "1ST MTG-HAZ @230 MAPLE WAY STREET FLOWERS, WY 23042", "230 MAPLE WAY STREET FLOWERS, WY 23042" }; for (String s: input) { // | start of input // || 0 or more characters, reluctantly quantified // || | followed by 2 digits (non-capturing) // || | | replace with empty System.out.println(s.replaceAll("^.*?(?=\\d{2,})", "")); } Output 230 MAPLE WAY STREET FLOWERS, WY 23042 230 MAPLE WAY STREET FLOWERS, WY 23042 Note This is less elegant than actually looking for a delimiter. It seems your "bad" addresses all have a @ delimiting the start of the "right" address. I would probably investigate on how to turn that to your advantage instead.
1ee53bb4148afc3d1ff52f6c9028ea1727a7c55983a38501f68d7a729ecc6ee8
['bd38d12870774f3dbb0e5852c121a365']
Just a thought: your context.getAssets call throws the NPE (possibly because context is null). I think that's because you did not put Dictionary dictionary = new Dictionary(this); in the onCreate method actually. I would expect it to work (provided the file is there) if you put that code on onCreate, after super.onCreate(bundle). If you are worried about app initialization loading time, I suggest you use an AsyncTask to load your dictionary in a splash activity, so you can provide user feedback.
ca416a2de8c03ea08877e6a1d2ca035cfe3342fbc1ccacec8c383236ea0a9efb
['bd4b26241d684c6dbfe6ef8e5d1542c9']
I am setting Linux Hopping Station to another different servers. My current config to connect to another servers is using different port to connect. e.g ssh -D 1080 -p 22 <EMAIL_ADDRESS> ssh -D 1081 -p 22 <EMAIL_ADDRESS> Now what I would like to have to share the same port from the same box. ssh -D 1080 -p 22 <EMAIL_ADDRESS> ssh -D 1080 -p 22 <EMAIL_ADDRESS> But when I share it, I will get below error: bind: Address already in use channel_setup_fwd_listener: cannot listen to port: 1080 Could not request local forwarding. How could I configure the same port? help. thank you. I want to share the same port because this is needed when configuring firewall in Citrix Firewall on other machine, not needed to many many ports and keep changing when changing connection. thank you.
421715bb137ea579d94570117492731252ee83e67c29bf7bae40f3caf27ce644
['bd4b26241d684c6dbfe6ef8e5d1542c9']
`Boost.Spirit.Karma` is a good tip for performance, but beware that it has a vastly different methodology that can be tricky to adapt existing `printf` style code (and coders). I've largely stuck with `Boost.Format` because our I/O is asynchronous; but a big factor is that I can convince my colleagues to use it consistently (still allows any type with an `ostream<
7b8a9ebd37cc9a5a65399545b3baec4344f3de1ee139869ee2b989a6c9a516c3
['bd506de268fd47eeb46c1df6dfcec668']
Some background --- I have two tables One - table lists all the entities in the system , the other specifies the relationship between the entities Ask -- The ask is looking at the tables can we chart out relationship for each of the child entity to the parent. -- What I have done CREATE TEMP TABLE rell AS SELECT 3 child_id, 2 parent_id UNION ALL SELECT 2, 1 UNION ALL SELECT 4, 1 UNION ALL SELECT 6, 2 UNION ALL SELECT 14, 6 UNION ALL SELECT 15, 14 UNION ALL SELECT 7, 8 UNION ALL SELECT 8, 5 UNION ALL SELECT 9, 10 UNION ALL SELECT 11, 12 ; CREATE TEMP TABLE mapp AS SELECT 1 item_id, 'app' type UNION ALL SELECT 2 , 'ci' UNION ALL SELECT 3 , 'ci' UNION ALL SELECT 4 , 'ci' UNION ALL SELECT 5 , 'app' UNION ALL SELECT 6 , 'ci' UNION ALL SELECT 7 , 'ci' UNION ALL SELECT 8 , 'ci' UNION ALL SELECT 9 , 'app' UNION ALL SELECT 10 , 'ci' UNION ALL SELECT 11 , 'ci' UNION ALL SELECT 14 , 'ci' UNION ALL SELECT 15 , 'ci' UNION ALL SELECT 12 , 'ci' ; The above listing 'mapp' has all the entities ( type - app are the final parent ) and the rel table has the relations. Can I have the output of something like below original_child final_parent path 4 1 4>1 3 1 3>2>1 7 5 7>8>5 14 1 14>6>2>1 15 1 15>14>6>2>1 11 12 11>12 2 1 2>1 8 5 8>5 6 1 6>2>1
a1f5fd928e259da5f947bd8d7da14f627fd065ade48e79bcba0046905d840895
['bd506de268fd47eeb46c1df6dfcec668']
Ok So after much struggle of searching the internet and trying out multiple options here is what I have come up with , it took a lot of time to understand the details but I think I have found a solution. Maybe it will save people of the trouble that I went though. I will try to explain as I go -- Initialise variables DECLARE steps INT64 DEFAULT 1; DECLARE table_holder ARRAY<STRUCT<original_child INT64, latest_parent INT64,path STRING>>; --- Set up dummy tables CREATE TEMP TABLE rell AS SELECT 3 child_id, 2 parent_id UNION ALL SELECT 2, 1 UNION ALL SELECT 4, 1 UNION ALL SELECT 6, 2 UNION ALL SELECT 14, 6 UNION ALL SELECT 15, 14 UNION ALL SELECT 7, 8 UNION ALL SELECT 8, 5 UNION ALL SELECT 9, 10 UNION ALL SELECT 11, 12 ; CREATE TEMP TABLE mapp AS SELECT 1 item_id, 'app' type UNION ALL SELECT 2 , 'ci' UNION ALL SELECT 3 , 'ci' UNION ALL SELECT 4 , 'ci' UNION ALL SELECT 5 , 'app' UNION ALL SELECT 6 , 'ci' UNION ALL SELECT 7 , 'ci' UNION ALL SELECT 8 , 'ci' UNION ALL SELECT 9 , 'app' UNION ALL SELECT 10 , 'ci' UNION ALL SELECT 11 , 'ci' UNION ALL SELECT 14 , 'ci' UNION ALL SELECT 15 , 'ci' UNION ALL SELECT 12 , 'ci' ; SET table_holder = ( SELECT ARRAY_AGG(STRUCT(a.item_id, b.parent_id, CONCAT(CAST(a.item_id AS STRING),">",CAST(b.parent_id AS STRING))) ) cls from mapp a inner join rell b on a.item_id = b.child_id where a.type!='app') ; LOOP SET table_holder = ( SELECT ARRAY_AGG(STRUCT(a.original_child, coalesce(b.parent_id,a.latest_parent), coalesce( CONCAT(path,">",CAST(b.parent_id AS STRING)),path)) ) cls from UNNEST (table_holder) a left outer join rell b on a.latest_parent = b.child_id ) ; SET steps = steps+1; IF steps=5 THEN LEAVE; END IF; END LOOP; SELECT * from UNNEST (table_holder); Arrays and struct have been utilised as they are easier to play with. and bigquery scripting has been used for looping. Runaway condition can be increased if people expect many levels. Here is the final output original_child final_parent path 4 1 4>1 3 1 3>2>1 7 5 7>8>5 14 1 14>6>2>1 15 1 15>14>6>2>1 11 12 11>12 2 1 2>1 8 5 8>5 6 1 6>2>1 Hope it helps someone down the line for similar exercise.
d6ae9f1fc58b2094a135a3f505041c491e78a2f7714c317e9a256b4878aee69f
['bd7204da53b04b4fb3e65c0a51e08703']
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *listData =[self.tableContents objectForKey: [self.sortedKeys objectAtIndex:[indexPath section]]]; NSUInteger row = [indexPath row]; NSString *rowValue = [listData objectAtIndex:row]; NSString *message = [[NSString alloc] initWithFormat:rowValue]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Better Be There Or Be Watching It!" message:message delegate:nil cancelButtonTitle:@"Go Knights!" otherButtonTitles:nil]; [alert show]; [alert release]; [message release]; [tableView deselectRowAtIndexPath:indexPath animated:YES]; } Line of code that throws error: NSString *message = [[NSString alloc] initWithFormat:rowValue]; ---------- Warning Message: format not a string literal and no format arguments
2f8d1b4110eaa68e456fa86ab4e77e403860e2a71aa37cecf62d776e8758e405
['bd7204da53b04b4fb3e65c0a51e08703']
Not quite sure what you mean. I'll input a bigger block of code, that might help. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *listData =[self.tableContents objectForKey: [self.sortedKeys objectAtIndex:[indexPath section]]]; NSUInteger row = [indexPath row]; NSString *rowValue = [listData objectAtIndex:row]; NSString *message = [[NSString alloc] initWithFormat:rowValue]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Better Be There Or Be Watching It!" message:message delegate:nil cancelButtonTitle:@"Go Knights!" otherButtonTitles:nil]; [alert show]; [alert release]; [message release]; [tableView deselectRowAtIndexPath:indexPath animated:YES]; }
b2f5f8332149592ccbb577b93e0c14b2a6ff2656c0968653d590c1c1fec235b0
['bd7bcd35d4354ff7bffb91a37f82f9f1']
According to ArchWiki: Tip: Compression can also be enabled per-file without using the compress mount option; simply apply chattr +c to the file. When applied to directories, it will cause new files to be automatically compressed as they come. Very nice! God bless BTRFS! Also, from the BTRFS wiki: Can I force compression on a file without using the compress mount option? Yes. The utility chattr supports setting file attribute c that marks the inode to compress newly written data.
dcdb35ddf12db14ac73f15ad48b5532be30d823eb35c0d5b84e52363e3ca5b48
['bd7bcd35d4354ff7bffb91a37f82f9f1']
I would like to pass a url like a query param to a proxy if the user agent is a crawler. I have: if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|Facebot|developers\.google\.com") { // Get the request Url, such as http://my-page.com/foo/bar/ // pass to the proxy as query param such as: http://localhost:3030?page=http://my-page.com/foo/bar/: }
229df9e06541950fc6621b54cc1b6d83c7daf4dbee1434aa1f07516e199decaf
['bd7c535c38b043dba368451a27702b1a']
Olá, <PERSON>. Com o trecho de código abaixo você conseguirá ler o conteúdo de cada versão de um arquivo dentro de uma biblioteca. foreach (SPSite tmpSite in tmpRootColl) { foreach (SPWeb tmpWeb in tmpSite.AllWebs) { foreach (SPList tmpList in tmpWeb.Lists) { if (tmpList.BaseType == SPBaseType.DocumentLibrary & tmpList.Title == "Docs") { foreach (SPListItem tmpSPListItem in tmpList.Items) { if (tmpSPListItem.Versions.Count > 0) { SPListItemVersionCollection tmpVerisionCollection = tmpSPListItem.Versions; SPFile tmpFile = tmpWeb.GetFile(tmpWeb.Url + "/" + tmpSPListItem.File.Url); foreach (SPFileVersion tmpSPFileVersion in tmpFile.Versions) { StreamReader reader = new StreamReader(tmpSPFileVersion.OpenBinaryStream()); string textoDoc = reader.ReadToEnd(); } } } } } } } Faça alguns testes e modifique conforme necessidade. Creio que pode partir deste código aí. Abs
b83d49497f4bd15cc472fded9c1344f0f006373318cd0d36131b6d7d1d43922b
['bd7c535c38b043dba368451a27702b1a']
I am a newbie in developing wp themes and having troubles showing my cpt. I added new cpt in my functions.php file: // Creates Testimonials Custom Post Type function testimonials_init() { $args = array( 'label' => 'Testimonials', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => 'testimonials'), 'query_var' => true, 'menu_icon' => 'dashicons-format-quote', 'supports' => array( 'title', 'editor', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'thumbnail', 'author', 'page-attributes',) ); register_post_type( 'testimonials', $args ); } add_action( 'init', 'testimonials_init' ); And I have created a new page template and added this code: <?php /* * Template Name: Testimonials */ ?> <?php get_header(); ?> <div class="container"> <div class="content-page"> <h1><?php wp_title(); ?></h1> <title><?php wp_title(); ?></title> <?php $query = new WP_Query( array('post_type' => 'testimonials', 'posts_per_page' => 5 ) ); while ( $query->have_posts() ) : $query->the_post(); ?> <?php endwhile; ?> </div> </div> <?php $args = array( 'post_type' => 'testimonials', 'posts_per_page' => 10 ); $the_query = new WP_Query( $args ); ?> <?php if ( $the_query->have_posts() ) : ?> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><?php the_title(); ?></h2> <div class="entry-content"> <?php the_content(); ?> </div> <?php wp_reset_postdata(); ?> <?php else: ?> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?> <?php get_footer(); ?> I want my page to show all the testimonials on the front end and I am not able to that and getting this error: Parse error: syntax error, unexpected 'else' (T_ELSE) Thanks guys!!!
63284b5e22f81d016396249625519c6fca6cecc49fa882e99fca3415bbef6bc0
['bd8e720c65644c989db2278e6d06071a']
ViewPager will initialize two fragments minimally. ViewPager allows us to set setOffscreenPageLimit(), but it require at least 1, so it will initialize first and next fragment. Read more here ViewPager.setOffscreenPageLimit(0) doesn't work as expected Try to invoke code in fragments by setting onPageChangedListener() in MainActivity, so you can execute code when user swiped/opened fragment.
1d27de1e7192e379fa6c1b3761f883da543ab19e622158f5e16ffca74640ff3a
['bd8e720c65644c989db2278e6d06071a']
Try this code: public class MyTextWatcher implements TextWatcher { private String oldText = ""; private String newText = ""; @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { this.oldText = s.toString(); } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { newText = s.toString().replace(oldText, "").trim(); } @Override public void afterTextChanged(Editable s) { } } Info about text watcher: Differences between TextWatcher 's onTextChanged, beforeTextChanged and afterTextChanged