Posts

Showing posts from July, 2015

java - Gradle dependencies: compile project by relative path -

Is it possible to specify a dependency on another gradeal project in the granular (in android studios) outside the current project limits? For example, with a relative path like this: dependence {collection project ('../../ stdlib / dagger'}} MyApp (path / user / foo / workspace / mypad) The app (Path / User / Foo / Workspace / MyPass / App) And I have an Android Library Project with 3 subdomules: stdlib (path is / user / foo / Utilities (Path / User / Foo / Workspace / Stadlib / Utilis) http (Path / User / Foo / Workspace / Stadlib / HT) / Li> What I have to do is compile the Dagger, Util, http module in the MyApp project. The Stidelib Library module under heavy development And MyApp will grow in the form of Growth, so I do not want to push them into a Mewen repository. I am a little change. is likely to add another Gredle projects in some way? I will push the study library into the Maven repository after the source is in search of a temp...

javascript - geocoder.geocode function does not work -

Hi, I want to land down the place I entered. But it seems that the geocoder.geocode function does not work here it is part of the JavaScript $ ('#InputButtonGeocode'). Click (function () {var sAddress = document.getElementById ('inputTextAddress') .value; geocoder.geocode ({'address': sAddress}, function (result, status) {if (position == google.maps.GeocoderStatus .oK) {map.setCenter (Results [0] .geometry.location); Var Marker = New google.maps.Marker ({Map: Map, Status: Results [0] .geometry.location});} and {Warning} ("The geocode was not successful for the following reason:" + status); This should be a simple problem, but I can not find this problem That is JSFDL link. Please help me Thanks, Good things. It does not seem that your initial function is ever going and therefore Your geographic object can never be created, and this API is not compatible with the Google Maps Embed (iframe) API. For example, you can see that they us...

javascript - Why is my embedded ruby json string encoded with html entities when parsed in the view? -

I have taken a rail operation that requests a GET for the service and then replies to the answer @job_data. The code works fine in retrieving the response, and I've verified that the Jason object looks correct. def show @ url = URI.parse (@@ jobs_base_url + "/" + params [: ID] + "? TestMode = true") req = Net :: HTTP :: Get New (@ url.to_s) res = Net :: HTTP.start (@ url.host, @ url.port) {| Http | Http: request (req)} @job_data = HTMLEntities.new.decode res.body end However, I have to javascript a bit to manipulate DOM elements using this json object I am trying. I am trying to incorporate the script into HTML to do something basic with the JSN object, but it may not seem to be correctly passed: & lt; Script type = "text / javascript" charset = "UTF-8" & gt; $ (Function () {var $ data = & lt;% = @ job_data%> $ ('# jobable') .andend ($ data.Id); when I debug I see that all the entities in the string are ...

php - Problems with preg_match -

I am using preg_match as a way of validating input on a form. Specifically, I am trying to validate the input of currency I is the function: if (preg_match ("/ ^ \ $ (((\ d {1,3} ,) + \ D {3}) | \ d +) \. \ D {2} $ / i ", $ inString)) {back true; } And {return false; } I can get it to work on all this. I return false, irrespective of what I feed it (including legal stars). I'm sure I'm doing something clearly wrong, but I can not see it. You know how it is ... Anyone have any suggestions? Something like this: $ inString = '1550.50'; If (preg_match ("/ \ b \ d {1,3} (?:??? \ D {3}) * (?: \. \ D {2})? \ B /", $ inString)) {echo "truth"; } Else {echo "wrong"; } Explanation: \ b # claim the word limit \ d {1,3} # 1-3 digits (?: # After this group ...,? # An optional comma \ d {3} # exactly three digits) * # ... in any number (?: # After this group ... \. # A literal dot \ d {2} # exactly two digits)? # ... ...

ios - Core Data UITableView, temporarily deleting cell (obj-c) -

I'm populating my table with core data objects and I'm trying to implement some delete functionality. Although I am planning to add shake to the undo, so I do not want to save the managed object reference immediately. My problem is that I am defining the number of cells with the _entity.items.count that does not change until I save the managed object context. So in short, is I going to keep a counter that I add and subtract every time that the user removes or adds an item again? (Do I want to reduce it by counting) or is there an alternative (preferably cleaner) method to deal with this problem? Thanks guys.

ios - UITableView - Controlling or preventing the delete for a specific row in a section -

I am trying to stop the deletion for each last line in each section of my UITableView control. I wrote code that has been working so far. Is there a way to prevent the delete button from appearing in a specific line in a specific section when editing the UITWV mode? Table view: (View UITableView *) View Comment tab: (UITableViewCellEditingStyle) ROATI and Appet for editing style: : (NSIndexPath *) indexPath {NSInteger section = indexPath.section; NSInteger Line = indexPath.row; // If the table view is asking for a command command ... if (edit type == UITableViewCellEditingStyleDelete) {// stop the removal of the last line length = [[[MyItemStore SharedStore] getItemsForGivenSection: section] count] ; // Prevent the last line from being deleted (line == length) {return; } NSArray * items = [[MyItemStore SharedStore] getItemsForGivenSection: section]; MyItem * item = item [row]; [[MyEstmestore ShareStore] removedEstormation: Item section: section]; // Also delete that line f...

ios - linking to third-party static library: "file was built for archive which is not the architecture being linked (i386)" -

I am trying to use a third party open source C ++ static library. I downloaded the archive from the project's web site, run ./configuration - disabled-shared , then create , test , and install . (I am a UNIX novice, so it was following the instructions given on the project's web site.) In the encode, I clicked under the link from the lib folder. Added include folder in the binary, header search path with libraries, and added the -ObjC to another linker flag (although I do not think since the library One important is C ++) When I try to build a project, I get several warnings like ld: warning: file / user / & Lt; My name & gt; / Dropbox / Computing / COIN -OR / Cbc-2.8.10 / lib / libOsiCbc.a, the file was created for archiving which is not related to architecture (i386): / user / & lt; My name & gt; / Dropbox / Computing / COIN-OR / Cbc- 2.8.10 / lib / libOsiCbc.a and many errors such as Undefined symbols for architecture I386: Referenc...

python - Open Image From Online, Save To Server Flask -

I am using a flask to open an image from the URL. file = cStringIO StringIO (urllib.urlopen (URL) .read ()) img = Image.open (file) Then move the image I want to save it on my site. When I do this, I get traceback (most recent call final): file "/ library / picture / 2/2 / site-package / flask / search", line Return to 1836, __call__ Wsgi_app response = self.make_response (self.handle_exception (e)) file "/ Library / Python / Wsgi_app (environment, start_response) file" / library / Python 2/7 / site-package / flask / search ", line 1820, 2.7 / site-packages / flask / app.py ", line 1403, handle_exception reraise (exc_type, exc_value, tb) file" / library / python 2/7 / site-package / flux / "line 1817, wsgi_app in response = Self.full_dispatch_request () file "/ library / python 2/2 / site-package / flask / search", line 1477, full_dispatch_request rv = self.handle_user_exception (e) file "/ library / python / 2.7 / s ...

javascript - How to count the number of elements in this json object? -

इस सवाल का पहले से ही एक उत्तर है: 15 उत्तर 9 जवाब मैं जावास्क्रिप्ट में इस JSON ऑब्जेक्ट के लिए तत्वों की संख्या प्राप्त करना चाहता हूं। डेटा = {name_data : {नाम: "डीडी",}}} सही उत्तर होना चाहिए 4. मेरा कोड डेटा है। Name_data.length लेकिन यह एक अपरिभाषित ऑब्जेक्ट देता है। इस JSON ऑब्जेक्ट में तत्वों की सही संख्या जावास्क्रिप्ट में कैसे प्राप्त की जा सकती है? यह फ़ंक्शन आपको मदद कर सकता है फ़ंक्शन की लंबाई (ओबीजे) {लौटें ऑब्जेक्ट.कीज़ (ओबीजे)। लम्बाई; } अब आप इस फ़ंक्शन को इस तरह कॉल कर सकते हैं लंबाई (डेटा); // 1 लंबाई (डेटा। नाम_डेटा) / / 4 रिटर्न देता है

java - How to properly update a line of text -

I am trying to create a basic non-static line of text that does not automatically reprint but \ R either is not working or I am doing it wrong; I'm a very new person for Java so I'm sorry if the answer is really clear. Here is my code: import java.util.Scanner; Public class textfoit {public static zero principal (string agre []) {int monetary strength = 10; Int YourHealth = 15; While {true} {System.out.println ("............"); System.out.print ("\ r ............"); System.out.println ("| |"); System.out.print ("\ r | |"); System.out.println ("| 0 0 |"); System.out.print ("\ r | 0 0 |"); System.out.println ("| ------- |"); System.out.print ("\ r | ------- |"); Println ("............"); System.out.print ("\ r ............"); Println (MonsterHealth); System.out.print ("\ r" + MonsterHealth); Println (""); Println (""); Println ("............

Testing facebook javascript Login from localhost domain -

I just followed the excellent guide here:. How to use Javascript SDK to enable Facebook login for a website I have tried to do this - and when I click on my good login button, I get an error : the URL application is not permitted by configuration: the need to match one or more app does not allow URL by setting the website URL or canvas URL, or do One of the main Ape's domains should have a subdomain. I note the URL for this error: https://www.facebook.com/v2.0/dialog/oauth?scope = Public_profile% 2Cemail & amp; Response_type = any & amp; Redirekt_uri = https% 3A% 2F% 2Fwwwkfesbukkcom% 2Fdialog% 2Freturn% 2Farbiter% 3Frelation% 3Dopener% 26close% 3Dtrue% 23origin% 3Dhttp% 253A% 252F% 252Flocalhost% 253A56378% 252Ff1c45491ec & amp; Seen_revocable_perms_nux = false & amp; Ref = LoginButton & amp; Auth_type = & amp; Default_audience & amp; State = fdcac98d4 & amp; APP_ID = 251165285007053 & amp; Client_id = 251165285007053 & amp; D...

objective c - Algorithm to decide if true based on 0% - 100% frequency threshold -

Sorry, this is a duplicate question. I did a search but I was not sure what to really find. I am writing an app that scans one, when the scan is completed we need to decide whether an item is found or not. Whether the items are not found, the threshold is determined by the user which can set: 0% of the time, 25% of the time, 50% of the time, 75% of time or 100% of the time. Obviously, if the user chooses 0% or 100% then we can use true / false but for the frequency but I am painting on an empty space how it works for other thresholds. should do. I think that every time I get a monster I need to store and raise some values. Thanks for any help in advance! As As @nix points, as you would like, a random number and threshold based on the percentage of that time Want to generate, when you want 'get something' ' You need to be careful that the range you select and the way you get desired Threshold, along with the result, also use the distribution of random number...

ios - SWTableViewCell's RightUtilityButton how to directly display when I click the table cell -

I hope SWTableViewCell's RightUtilityButton will be displayed when I click on the table cell (drag) . SWTableViewCell does not provide this interface call showRightUtilityButtonsAnimated: method. I am using example code. Change Cosiolov endindeptext and yourCellClassName from UMTableViewCell - (zero) tableview: (UITableView *) table view SelectionRowAtIndexPath: (NSIndexPath *) indexPath {NSLog (@ "Cell selected index path% ld:% ld", (long) indexPath.section, (long) indexPath.row); NSLog (@ "Selected cell index path% @", [Self-televiewview indexPathfolded road]); If (TableView.isEditing!) {[Uncheck tableView currentpace: Animated Pathway: Yes]; } // If you want to hide another cell that was first opened (in the UMTableViewCell * cell [tableView visibleCells]) {[cell hideUtilityButtonsAnimated: Yes]; } UMTableViewCell * cell = (UMTableViewCell *) [Table View CellForraAttandExpath: IndexPath]; [Cell showreal utility buttons]; }

class - C++ Stack Template SIGTRAP Error -

Start learning about stack templates and work on push function while participating in a problem whenever I resize I try to free the memory for The function works fine all the way until it reaches the maximum capacity, and then immediately goes into a series of error messages not actually picked by my debugger. The function is a header file with error, Also calls this function. #include & lt; Iostream & gt; #include & lt; String & gt; # Include & lt; Sstream & gt; using namespace std; Template & lt; Class T & gt; Class MyStack {Private: T * Data; Int topVal; Int capacity; Public: MyStacks () {Capacity = 10; Top Val = 0; Data = new t [capability]; } ~ MyStack () {Delete} data; Data = 0; } Zero push (t); T pop (); T top (); Bull is full (); Boole is empty (); String to string (); }; Template & lt; Class T & gt; Zero mystacks & lt; T & gt; :: push (t value) {if (! IsFull ()) {data [++ topVal] = value; } And {capacity * = 2; T * HoldPre...

html - Can I assign a <span> to an <a> element? Syntax? -

Is this a & lt; A element? If so, what is the correct syntax? I have tried both of these, but neither is working with my CSS. & lt; One span = "add_button" & gt; + Add a review & lt; / A & gt; & Lt; / Span & gt; & Lt; Span = "add_button" & gt; & Lt; A & gt; + Add a review & lt; / A & gt; & Lt; / Span & gt; this & lt; A href = "something" & gt; Must be & lt; Span & gt; Some & lt; / Span & gt; & Lt; / A & gt;

jquery - Invalid argument supplied for foreach() AJAX to PHP -

O people, I am trying to pass the value of the farm field through ARX in a PHP file that writes the data. A MySQL database. I have my standard form with a set of field entries: & lt; Input type = "text" name = "rname []" & gt; & Lt; Input type = "text" name = "rDateS []" & gt; & Lt; Input type = "text" name = "RDATF []" & gt; & Lt; Input type = "text" name = "rocost []" & gt; I'm pushing these values ​​by clicking on my PHP file $ ("# addRates_Submit"). Click (function () {var rName = $ ('# RNM'). Val (); var is RDTS = $ ('# RDDS'). Val (); var RDATF = $ ('# RDTF'). Val ( ); Var rCost = $ ('urphpfile', type: "post", data: $ .ajax post data $ .ajax for .val (); var (apc) = // server $. {"RName": rName, "RDateS": rDateS, "rDateF": rDateF, "rCost": rCost}, data type: "tex...

php - String to Array to <br/> list -

I have an item that gives me the result of string (26) "Cake 1 cake 2 cake 3 Cake 4 " The cake results from $ _ POST () so that it is the best way to make it, Ho: Cake 1 Cake 2 Just need to change the space & lt; Br> 's? echo str_replace ('', ' , $ _POST [' cake_list ']); Obviously you should sanitize the post, but this is a quick example for you.

ios - UICollectionViewCell which contains a UILabel and UIButton not recognizing touches on half the cell -

I've added the UILLunch and UIButton for a UICollectionViewCell, but when I touch / tap the cell it only registers my tap on the left. Do not pay attention to any touch or null on the right half of the half-cell cell? I should also note that it does not matter how long the text is in UILabel. Example text: @ "short text" @ "too long text in the text above," text "touch where the final" t "in. CODE: - (id) initWithFrame: (CGRect) frame {self = [super initWithFrame: frame]; if (self) {self.clipsToBounds = yes; MyLabel = [[UILabel alloc] initWithFrame: self.bounds]; MyLabel.frame = UIEdgeInsetsInsetRect (myLabel.frame, UIEdgeInsetsMake (0, SEARCH_CELL_PADDING, 0, SEARCH_CELL_PADDING +30)); MyLabel .textAlignment = NSTextAlignmentLeft; MyLabel.autoresizingMask = UIViewAutoresizingFlexibleHyight | UIViewAutoresizingFlexibleWidth; MyLabel.font = RECENT_SEARCH_CELL_FONT; MyLabel.textcolor = WK_COLOR_GRAY_77; MyButton = [[UIButton alloc] init...

python - List length in a while loop -

I am writing a program that compares coin to two players. I do not understand why the following while loop prints "Game over", even though the lanes of both lists are 5. When I type the lane (player_x_armi) or responds with the correct 5 then If I "or" from "and" This works fine " while len (player_1_army) or len (player_2_army) == 0: print (" game over ") lane (player_1_army) is not zero therefore, or is correct, thus while is looped. In any Boolean expression, if any number is present, then its evaluation is number! =! 0 . Instead, you'll need it: Lane (player_1_ army) == 0 or lane (player_2_ army) == 0

php string related to html text box -

I have a string variable in php where it should fit in different text boxes. Is this possible? As an example & lt ;? Php Print "Username Balance 100"; ? & Gt; and html form & lt; Html & gt; & Lt; Head & gt; & Lt; Title & gt; Exam page & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form method = "" action = "" & gt; Username: & lt; Input type = "text" value = "here $ php value" disabled & gt; & Lt; Br> Balance: & lt; Input type = "text" value = "here $ php value" disabled & gt; & Lt; Br> Amount: & lt; Input type = "text" value = "here $ php value" disabled & gt; & Lt; / Form & gt; As you can see, I want to place these string variables in these 3 boxes "Username" in the first box then "Balance" in the second box and then the third. Just do...

javascript - function addevent not working for IE 8 and less -

मैं फ़ंक्शन addEvent (element, myEvent, fnc) {return ((( Element.attachEvent) element.attachEvent ('पर' + myEvent, fnc): element.addEventListener (myEvent, fnc, false))}} के रूप में विस्तृत पर। अब क्लिक ईवेंट को विंडो तत्व के साथ संलग्न करने के लिए addEvent (विंडो, 'क्लिक करें ', myfunc); जहां myfunc एक कॉलबैक फ़ंक्शन है। समस्या यह है कि IE 8 इस फ़ंक्शन का उपयोग करके क्लिक ईवेंट को संलग्न नहीं कर रहा है, मैं इस फ़ंक्शन को IE 8 के लिए कैसे संशोधित कर सकता / सकती हूं? धन्यवाद

jquery ui - How to Load my Javascript file on a website that I have no access to its source -

I'm working on a monitoring system, it's a jquery-ui graph! Whenever it loads on my browser, I want to edit that graph! And I do not have access to the source! What can I do / do? How can you access the source if your screen is loading? I'm sure that you can wire sack on your computer which is coming to your computer, if for some reason you are unable to do this through your web browser. You should work on saving the page locally. This is going to be the best thing from your local PC if you are going to make a lot of changes and want to save your changes. You can also use some developer tools that have been created in your web browser. For example, with Chrome Inspector (F12) you can right click under the Elements tab and edit attributes or edit as HTML, and make changes in Inline CSS and JS. Take a look below the formulas tab for the included files.

c# - WebApi OAuth UseOAuthBearerAuthentication gives "Sequence contains more than one element" error -

I have configured my WebApi OAuth 2.0 via these lines: app. USEOAuthBearerAuthentication (new OAuthBearerAuthenticationOptions {Provider = New OthebeerAuthiconation Provider (),}); App.UseOAuthBearerTokens (OAuthOptions); But this gives me the following error on each request: Message: An error has occurred. Exception Message: More than one element exists in the sequence ExceptionType: System.InvalidOperationException StackTrace: On System.Linq.Enumerable.SingleOrDefault [TSource] (IEnumerable 1 Source) Microsoft.Owin.Security.AuthenticationManager.d__8.MoveNext () --- Finally, the stack trace was detected from the previous location- on the system. COMPLETER SERVICES Task aviator Firenoon success on the system. Timetable COMPLETER SERVICES Talk aviator Notice on handlennessant and debugger system (Task Task). System. Runtime. Completer Services. TaskAwaiter System.Web.Http.HostAuthenticationFilter.d__0.MoveNext () --- On 1.GetResult () --- The end of the stack trace from th...

ios - animated journey using mapkit polyline -

Good morning, I have an app that has a search list showing trops. After the selection one of them needs to see me on the trip after seeing a small car on the map, after all the coordinates related to each GPS point I am in my travel database for that trip originally from my app Has three login pages, search pages and mapviews. In the search page, I need to include a filter from the city name (start or end) and the date range of the trip. It is possible to include about once in the lower part of the map scene about the travel animation, play like the record player Bats, back and forth? Thank you in advance and sorry for my english. Brunix

processing - A paperjs-equivalent for python (specifically, Pythonista for iOS)? -

I have taken creative coding on my iPad and iPhone using Coda, Prokoding, and Pythonista. I really love the paper.js Javascript library, and I'm wondering how I can get functionality in paper.js when writing in Python. Specifically, I give vector math and route manipulation that gives paper.js. Things like finding the intersection of paths (clicks, mouse move, etc.) in two ways or binding events. There is an ImagePath module provided by Pythonsta, which does some path material but it is not as strong as paper. JS (it seems). Any thoughts? UI module actually contains a lot of vector drawing functions Inside a ui.ImageContext . ui.ImageContext is a thin wrapper around one of the Objective API (maybe CALayer ?), Drawing methods draws Custom view class method, but you can present these things in other contexts using a UIImageContext , so that you can get a static image.

Intellij shorthand for html tags -

Is there a cloak in the IntelItalics idea for HTML tags? I want to tag HTML code from shortcodes apart, is there any other short storyline for any other supported languages? (Please post questions with those languages ​​after answering) Use, IntelliJ supports it. Check for Amit for a quick start.

ssh - Migrate MySql Database To New Server -

I have exported my database in a .sql file. When I try and upload it comes to my new server because the user is denied access to 'username' @ '%'. The original database is called 'originalUsername_databaseName', as it seems that the new server requires the prefix 'Admin _' I'm sure this is the name of the database due to which the error is happening Is there a way to change? Make sure that your SQL file is not built-in database and the statement is not used. If this happens, remove them. Create the database manually and import the table for it.

testing - WebGL browser compatibility -

Which browsers are compatible & amp; Not compatible with WebGL (desktop + mobile)? Has anyone got a good reference / link that browsers are not compatible with WebGL technology yet? Thanks in advance for your help! Very good resource for various web APIs

php - .htaccess Rewrite Domain & Preserve Path -

Can someone help me rewrite a domain name but preserve the path? I do not think what I'm looking for can not seem to find, a lot of articles have been found about redirection, but not to re-write. www.domain2.com/path1/page.html as www.domain1.com /path1/page.html www.domain2.com/path1/page.html as www.domain1 .com / path1 / page.html I have enough domain names. Thank you very much for your advice or link to an article with the answer. Stu The following .htaccess code will do this RewriteBase / RewriteCond% {HTTP_HOST} at RewriteEngine! Domain1.com $ [NC] RewriteRule ^ (. *) $ Http://www.domain2.com/$1 [L, R = 301] For the difference in rewriting and redirection The first place is a location redirection which is not clear (the user will not see it in their browser address bar) Second is full redirection. Re-writing non SSL, as is the need to change the URL prefix to http to https and make sure you have a valid SSL certificate .

android - How to send a LocalBroadcast from adb shell? -

I know how to send a broadcast from ADB shell if the Android manifest has been declared a static receiver in the file but what Is ADB a way to send localBrandcast from shell? I think there is no way to achieve this, if it is true, how can I test a local broadcast effectively? Should I delegate the intentions of broadcasting a handler, whose behavior can be tested in isolation? But is there a way to send localBradecast from ADB Shell? No, because LocalBroadcastManager is an in-process event bus, and the shell is not in your process. How can I effectively test a local border? Using an instrumentation test with a test suite, such as the JUNनेट, it runs in the same process as if you have a code code, and so be able to send it to local broadcasters. needed. Should I intend to broadcast a handler whose behavior can be tested in isolation? This is probably a good idea.

Correct way to call "realloc" in Swift with a Float array? -

I'm trying to say what size is to send "realloc" when I call through Swift It seems that I want to add an extra byte , but I do not understand why typiaas floats = unsafepointant & lt; Float & gt; Let's FLOAT_SIZE = sizeof (float) func floats_realloc (floats: floats, qty_of_floats: int) - & gt; Floats {let KLUDGE = 1 // Why? Go qty_of_bytes = (qty_of_floats * FLOAT_SIZE) + kludge go realloced_floats = floats (realloc (floats, uint (qty_of_bytes))) return realloced_floats} If I set the 0 kludge here, This is what happens when I try to make room for a new member in a three-member array: In: [0.9, 0.9, 0.9] Out: What do I expect: Out: [0.9, 0.9, 0.9 , 0.0] The arrays I send are used in SWIFT And var foo_floats = Floats.alloc (QTY_OF_FLOATS) What's wrong with My call to call again? I have discussed this on Apple's developer forum. It has been learned that using the Swift Olock Oles Space for a Swift array, not a C ...

matlab - Finding the diameter of a graph -

In MATLAB, I left [0,1] X [0,1] equally evenly digits I am I keep the distance between the two points less than 0.25. To do this, the code (and the resulting graph is under plot). num_Rx = 50 Rx_positions = rand (num_Rx, 2); Generate edges between pairs of ideal for% 0.25. Adj_matrix = Void (num_Rx, num_Rx); I for = 1: num_Rx j = i + 1: num_Rx dist = norm (Rx_positions (i, :) - Rx_positions (j, :)); If the District & lt; 0.25; Adj_matrix (i, j) = 1; End end end data gplot (adj_matrix, Rx_positions) i.e. This is an unspecified graph, the weight of all is equal to 1. In diameter I want to say the graphallshortestpaths () (), and want to take the maximum value (diameter is the longest path to the longest). However, I am having difficulty calling this function - I can not understand how to call like examples, with my proximity matrix and / or my list node statuses. Especially I can not understand any example, how the given matlab code matches that data How do I go about...

java - Concurrency on Treeset using last method -

I want to apply a bean where I have TreeSet in the sorted order Caching Integer Only this method which uses TreeSet is addValue which is adding a new integer to the set, and getHighestValue using the sorted set from the previous () method is returning the final value in it. Is there any concurrency issue here? I am not using a clear Iterator, so there should be no concurrent problem in getting the highest value, but I do not know the last method can throw any of concurrent amendment or any other Exceptions if try two threads to add and receive the highest value at the same time. Yes, assuming multiple thread sets, and at least one is modified, there are concurrency worries By the way, you add many threads to action, which are definitely causing problems - worse than that, they ConcurrentModificationException s ConcurrentModificationException You have to be careful about issues of incorrect concurrency, such as trying to delete an item from a collection, as ...

java - How to start video quick on a JFrame using JMF -

Can anyone tell me what is the best way to play video in JPNL? I am currently working on a learning software where children will be played on video learning to learn something. Videos are stored in some folders. I have worked successfully using JMF but the problem is a bit slow. It takes some time to start the video, although the video is not very big (2-4 MB). What can I do to start it quickly, U public panel media panel Xanel {public static booolan play = false; Public stationary player media player; Public MediaPanel (URL Media URL) {Set Layout (New Border Layout ()); // Use a border layout / use light components for swing compatibility / / component control = mediaplayer.gate controlPanelContent (); } // and MediaPanel constructor throws public zero-play (URL-media-url) noplayer exposition, Canot Relleys Expression, IOE Expansion, Incompatible Source Expansion {Manager.ChatHunt (Manager. LightWiseSecurer, True); Println ("sdfdsg"); Mediaplayer = manager.creditedl...

c# - How can i encode each string? -

At the end of the loop I am getting a list and I look in each index inside: This is when the text is in encoding code in Hebrew: 65001 System.Text.Encoding.GetEncoding (65001) Public list & lt; String & gt; GetResponsers {String Content} {List & lt; String & gt; Thread list = new list & lt; String & gt; (); Int f = 0; Int startPos = 0; While (true) {string firstTag = " gt; // string first tag = ";>"; String end tag = "& amp; n"; // string endtags = ": that"; F = contents.IndexOf (first tag, startPos); If (f == -1) {break; } Int G = Content Index (last tag, f); StartPos = G + Last tag. String Regressor = Content Substrings (F + 2, G - F2); ThreadList.Add (responser); } Return thread list; } How do I implement encoding for each representative? This method is used after trying to use encoding: public list & lt; String & gt; GetResponsers {String Content} {List & lt; String & gt; Thread li...

Dice Notation in excel, get minimal value -

( With the help of a few friends I have made it: It takes expression in standard dice signage And gives fewer results. Public function rollin (such as range range) as the variant application. Voltage diem v string, new form in the form of string, form of demoda boolean dim de In the string dice = "D" gluta = False dicemode = False v = r.Value NewForm = "=" I = 1 lane (v) ch = mid (v, I, 1) if ch = Then again NewForm = NewForm & amp; "*" dicemode = True Glute = true if if notumeric (ch) and dicemode then dicemode = false newform = newform & end if if glute then ch = "1" glute = false End if NewForm = NewForm & Evaluation (NewForm) End Function When I feed it with 1D if I give it 1d4 + 4, I get 1 * 1 + 4 = 5 Here's my problem, when I call it D10, D12, D20 or D1 1 (or 1 digit) No dice with more than) It will only take the first number. Given 1d12 + 2, this 1 * 12 + 2 will give 1 * 14 + 2, given 1d14 + 2. I need th...

data.table - Finding sequences in rows in R based on the rep function on a certain column -

I'm trying to find a sequence of 0 in a row The representative work of the column below is my best effort which throws an error. I tried to use an application loop, but badly failed and I really do not want to use the loop, unless my true dataset I do not have nearly 800,000 lines The minister tried, but could not find anything and spent a few hours on this and no luck. I have also attached the desired output. Library (DataW) TEST_DF & lt; - data.table (INDEX = c (1,2,3,4), COL_1 = C (0,0,0,0), COL_2 = c (0,0,2,5), COL_3 = c (0, 0,0,0), COL_4 = c (0,2,0,1), day = C (4,4,2,2)) IN_FUN In addition, if possible, if the definition column has the value of "Y", then it should return the column indicator of the first event of the desired sequence, e.g. Since the first incident of 0, we are in COL_1, we have 2 columns for the INDEX column. Neither should receive and the line 2 NA because the definition "N", and so on. Feel free to make any edits to ma...

C variable assignment issue -

I think the title is not suitable for my question. (I appreciate it, if someone suggests a suggestion) I am learning with "CC Hard Way" I am using printf for output values ​​using the format specifier. This is my code snippet: #include & lt; Stdio.h & gt; Int main () {int x = 10; Float y = 4.5; Four c = 'c'; Printf ("x =% d \ n", x); Printf ("y =% f \ n", y); Printf ("c =% c \ n", c); Return 0; } This works because I expect when it comes to conversion, then I want to deal with it, it was all right until I got it done char to float was created to break it by converting this line: printf ("c =% f \ N", c); OK, I am compiling it and this is output: ~ $ cc ex2.c -o ex2 ex2.c: in the function 'Main': ex2.c: 13: 3: WARNING: Format '% f' is expected to 'double' type argument, but 'int' [-Wformat =] printf ("c =% f \ N "c); ^ The error clearly tells me that it...

php - Can't concatenate on an array - Parse error: syntax error -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब मैं क्यों नहीं उपयोग कर सकता हूँ यह सम्मिलन FILEPATH 'सरणी / अपलोड /' एक सरणी में ??? $ अपलोड = सरणी ('पथ' = & gt; FILEPATH। 'संपत्ति / अपलोड /', // पार्स प्राप्त करें त्रुटि: सिंटैक्स त्रुटि, अप्रत्याशित '।', उम्मीद '' '' अनुमति_प्रकार '= & gt; 'जीआईएफ | जेपीजी | पीएनजी'); मुझे एक वाक्यविन्यास त्रुटि मिलती है: पार्स त्रुटि: वाक्यविन्यास त्रुटि, अप्रत्याशित '।', उम्मीद '' '' सरणी एक वर्ग में है, लेकिन एक विधि से बाहर है, जब किसी कारण से सम्मिलन कार्य नहीं कर रहा है। class फू {$ अपलोड = सरणी ('पथ' = & gt; FILEPATH। 'संपत्ति / अपलोड /', अप्रत्याशित '।', उम्मीद '' '' स्वीकृत_प्रकार '= & gt; 'जीआईएफ | जेपीजी | पीएनजी'); } काम करने के लिए आपको एक विधि के अंदर इसे सेट करना होगा class Foo {public function daa () {$ this- & gt; upload = सरणी ('पथ' = ...

css - JQuery hover overlay issue -

I am creating overlays for about 20-30 items, when you rotate it over the overlay show, the following code works But does it have a way of making it easy, so I do not have to repeat this code thirty times? Overlays are also different, so for each ID, for example # 1, for a different overlay example, I have # 1 to # 30. $ ("# 1"). Hover (function () {$ ("# 1.beastoverlay"). Show ();}, function () {$ ("# 1.beastoverlay"). Hide ();}); $ ("# 2") hover (function () {$ ("# 2.beastoverlay"). Show ();}, function () {$ ("# 2.beastoverlay"). Hide ();}); Thanks in advance double or one More selectors for the same work var overlay = "# 2, # 1, #Soide"; $ (Overlay) .hor (function () {$ (this) .next (). Show ();}, function () {$ (this) .next (). Hide ();});

tkinter - Python multiple treeviews -

Image
I am trying to create a GUI which is using a tinkanner. How can I get 3 trivews - the third on the bottom of two trees at the top and two trees at the top I got the two sides, I had assumed the side for the first value, but when I use the bottom for the third it comes in the middle of the last two trees. container = ttk.frame () container.pac thanks for help ( When you insert upper-left and upper-right tree view widgets, then pack them with side = LEFT so that they are packed with left to to the right . (You can use side = right if you can pack a right first). In addition, pack up from top to bottom ( Side = Top Or switch to clear side ) from Tikenetr import * Import Titik # Python 3.x #from tkinter import * # of Tnkintr import TTK root = TC (in) Upri_kanten = Frame (root) Upri_kantiarkpak () Bayan_try = Titik. success (Upri_kanten) Bayan_try. peak (side = left) Shi_try = Titik. Riwuwu (upper container) Shi_trykpak side = lEFT) lower_tree = ttk.Treeview (r...

java - Functionality calling a servlet that creates 3 tables with interconnected relationships -

How do I create a servlet called functionality which creates 3 tables with interconnected relationships, which means that is a foreign key? These are the codes. CreateTable.java package com.dls.csb.process.web.controller; Import java.io.IOException; Import javax.servlet.ServletException; Import javax.servlet.annotation.WebServlet; Import javax.servlet.http.httpServlet; Import javax.servlet.http.HttpServletRequest; Import javax.servlet.http.HttpServletResponse; Importing com.dls.csb.utility.SQLOperations; @WebServlet ("/ createtable.html") Public Category CreateTable HttpServlet Extended {Private Static Last Long Serial VERSIONUID = 1 L; Secure zero doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doPost (request, response); } Secure zero doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {try {SQLOperations.createTable ()} response.sendRedirect ("index.jsp...

java - Fragment's onActivityResult is not Called -

मेरे दो टुकड़े हैं: होमवर्क लिस्टफ्रैग्मेंट और होमवर्कफ्रैगमेंट। HomeworkFragment होमवर्क फ्रैग्मेंट की एक ऐसी घटना शुरू करेगी, जैसे: होमवर्कऑबैक्ट होमवर्क = नया होमवर्कऑब्जेक्ट (); HomeworkLab.get (getActivity ()) addHomework (होमवर्क)। आशय I = नया आशय (getActivity (), होमवर्कपैगर गतिविधि। वर्ग); I.putExtra (होमवर्कफ़्रेग्मेंट.एक्सटीआरए_एचओईएमईओईएमईआरईआरआईडीआईडी, होमवर्क। जीआईडी ​​()); startActivityForResult (i, REQUEST_DELETE_HOMEWORK_ID); मेरे HomeworkFragment वर्ग में, मैं चाहता हूं कि उपयोगकर्ता होमवर्ककास्टिंग होमवर्क इशारा के इस उदाहरण को हटाने के लिए विकल्प मेनू में एक बटन प्रेस करने में सक्षम हो, जो होमवर्क स्टोरीमेंट द्वारा होमवर्क फ्रैग्मेंट के लिए दिया गया था। इसलिए, मुझे जो भी ज़रूरत है, होमवर्क फ्रैग्मेंट के लिए एक ऐसा परिणाम लौटाया जा सकता है जिसके परिणामस्वरूप होमवर्क इंडियाविबेट के होमवर्क ऑब्जेक्ट को होमवर्क लिस्टफ्रैग्मेंट में शामिल किया जा सके ताकि इसे हटाने का प्रबंध किया जा सके: @Override सार्वजनिक बूलियन ऑनऑप्ट्सइटम चयनित (MenuItem आइटम) {स्विच (it...

c++ - boost atomic class make initialize values different from member initialization list -

I first: Promote atomic class and there is an initial problem. I have an active data structure struct rowactive data {RoActivate Data}: _rowActive (0), _rowActiveFile (0), _rowActiveTrack (1) {} size_t _rowActive; Size_t _rowActiveFile; Size_t _rowActiveTrack; }; and Row Active Structure use it Stroke IOActive (Virtual Zero SatelliteActive (size_T line) = 0;}; Structure Row activated: Public IROactive {Row Active () {} Virtual Zero Retroactive (size_T line) {RoActivate Data TMP Data; TmpData._rowActive = Row; TmpData._rowActiveFile = Line * 2; TmpData._rowActiveTrack = Row * 3;} // boost :: atomic // & Lt; rochitvdata & gt; _free; roeviddata_data;}; my question The process is going on, I see that everything is fine, it tells me my values ​​ _rowActiveFile 0 and _rowActiveTrack is 1. But when I make a comment, // rovitdata_data; and extract the atomic comment Promotion: : Atomic Roth Active Data This gives me the garbage value I What could b...

Rails: Pretty print JSON without overkill -

I am using code below to display an unauthorized message in JSON: def Render_unuthorized # Displays unauthorized messages because the user has not passed the appropriate authentication parameter # Issues ['WWW-Authenticate'] = 'Token realm = "API"' to submit json: {error: {type: "unauthorized", message: "This page can not be reached without a valid API key." Which output: {"error": {"type": "unauthorized", "message": "This page can not be accessed without a valid API key."} } So my question is: There is a way to print this message (without putting it in a different view and using some 3rd party gem ). Edit: What is Beautiful Print? Location properly, and well .. I think I would like to see the output: {"error": {"type": "unauthorized" , "Message": "This page can not be accessed without a valid API key."}} solution w...

Java supports generic types and methods. Why not generic fields? -

Despite the fact that janetics [Java Runtime] is not in Java, I was recently caught in some kind of generic Hell is there Status (simplified and useless reference removed): A library is A, which provides interface IA. A library is B, which provides interface IB. Both libraries are third party libraries on which I do not have any control. (In reality, there are more than 2 but they are not so complex yet.) An engine developed by my company , Which defines both objects and heavily uses / implementing both IA and IB Since our engine should deal with all implementations, we should only implement some interface IAB, IB Can not define and allow all sections to be implemented. Therefore, to get the collection time, type-security & amp; Method risk, it was decided to use normal methods. Therefore, whenever an 'IAB' is required, we will be able to & lt; IAB IA & amp; IB & gt; Do this with zero (IAB some object withboth API) . It works very well, though i...

(VB.NET) Rotate Bitmap in Image WPF XAML -

First of all, I want to clarify that I am German so please do not pay attention to some grammatical mistakes. Image name = "imgdisp"; problem My problem is that I want to rotate the bitmap which is shown in an image control in WPF using the XAML code grid. Columnps = "4" margin = "10,2,10,10" grid. Rau = "3" grid. Rowspan = "2" & gt; & Lt; Image.Source & gt; & Lt; Transformed bitmap source = "{binding path = current current}" & gt; & Lt; TransformedBitmap.Transform & gt; & Lt; RotateTransform angle = "90" /> & Lt; /TransformedBitmap.Transform> & Lt; / TransformedBitmap & gt; & Lt; /Image.Source> & Lt; / Image & gt; class property itself looks like this: public class PropertyClass Implements INotifyPropertyChanged public event PropertyChanged PropertyChangedEventHandler as _ Implements Private Sub INotifyPropertyChanged.PropertyChanged NotifyP...

html - Knockout checked binding with no default -

I am using knockout to handle interactivity in web applications. I'm trying to create a multi-option quiz widget. I want to present a question, and then a group of radio buttons that the user can choose from the user, I do not want a default answer. I have the following in my code: & lt ;! - Aggram: {Data: Answer, as: 'Answer'} - & gt; & Lt; Li class = "list-group-item" & gt; & Lt; Input type = "radio" name = "answer" data-bind = "checked value: answer, checked: $ parent.current.problem.response" & gt; & Lt; Span data-bind = "mathjax: answer.valuext" & gt; 1.5 & lt; / Span & gt; & Lt; / Li & gt; & Lt ;! - / ko - & gt; Now, the knockout document says: When the user changes which radio button is selected, then the value of your model's property is equal to the price In the preceding example, the selected radio button will be set, by clicking on the radi...

javascript - Parse CloudCode and nested/looped queries -

I am trying to wrap my head around the promise in a parse cloud code but I'm struggling. Save Send a push message Every time I try it, saves the whole, but async does not push. I understand that I want to use the promise, but how do I have to do this within the loops, and many concrete examples do not appear for a series (push after saving). Can anyone help?

javascript - Fetch records using relative time interval condition -

Whether it is possible to get a record using relative time interval, suppose I want to see all records satisfying the following formula : (NOW () - Model Deliverate) & gt; 24_HOURS You can do something like this: (Now () - 24_HOURS) & gt; Model.deliveryDate that will translate to something like: var aDayInMs = 1000 * 60 * 60 * 24, aDayAgo = New Date (New Date (.) GetTime () - ADAIM); Query.lessThan ('Delivery Date', Idea); The query is actually edited to act as the specified.

mysql - Setting up a local call to DB with an online PHP file - trouble connecting -

Trying to find out what to connect to a local PHP server with an online PHP file. Although I'm getting connection errors Warning: mysql_connect () [function.mysql-connect]: [2002] No connection can be made by actively denying the target connection (attempt to connect via TCP : // localhost: xxxx) in E: \ web \ example.com \ uploads \ readDB.php on line 8 Especially I'm having trouble Mysql_connect ("localhost") "" the_sql_server_name \ SQLEXPRESS "," mysql "); Mysql_select_db (" ACME ") or die (mysql_error ()); $ Data = mysql_query ("Choose from the trading account") or die (mysql_error ()); Mys Runs locally (SQL Server Studio Management 2012), and I'm trying to connect to Table Databases specific to DB from table ACCOUNT. How do I connect to this local table To successfully show up with PHP? I currently use Windows authentication when I run the server, even in case. I can not find any useful reso...

function - Using the math library to display the sine of 1 radian rounded to three decimal points in C -

I am working on a short tutorial and I am a bit confused about using the sin function. The objective of this challenge is to use the mathematical library to score the sign of 1 radians up to three decimal digits. The answer should be 0.841. However, I do not know how to use the function or whether I am confused with this problem or not. #include & lt; Stdio.h & gt; # Include & lt; Math.h> # Include & lt; Stdlib.h & gt; Double sin (double x) {double radian = 1; Redion radians; } Int main (int argc, const char * argv []) {printf ("1 radian has sign is% .3d. \ N, ????)"); Return 0; } Your own (broken) sin function - Already use one in the math library: printf ("1 is the sign of radians% .3f. \ N", sin (1.0));

Data dictionary file for database in SQL Server 2008 R2 -

I need to create a data dictionary that lists all tables, columns and data types in PDF file format. I use SQL Server 2008 R2 How do I get this information? I was able to see the schema view because someone was suggested with all my information, but how can I create a PDF file form with that information? I recommend using a paid product for what you are looking for , Or, ..

google chrome - Why are images from a previously visited website rendering transparently over another website? -

After visiting a website for a long time, and after leaving another open during that time it seems that The layout of the first appears on the other, it is mainly used when using chrome, but when there is a problem on Chrome, it seems that it stays in memory and is also in Firefox. I've read about memory leaks, but I'm not sure that this is a problem, and if I'm the only one who has it, I'm mainly on the website I'm working on, so this is the issue. , But it happens on the black bars of Facebook, and the second website jeuxvideo.com. (This template is my website uses). Here is an image showing the image, where the layout of YouTube overlays another website (the transparent grid you can see on the rest of the website): Is it Chrome's Is there a bug with? Because I have seen everywhere and it does not seem that someone else has this problem, or maybe it's just my computer? Perhaps this is possible where the color in the monitor is temporarily after a l...