Posts

Showing posts from January, 2015

android - How to style buttons in Alert Dialog Fragment using Material Design? -

Image
I want to change the default button style on a warning dialog. The standard warning dialog fragment (in Android L) looks like this: I want the right button to style it as a normal button rather than a straight button, Google starts using this method in various dialogs like: Do anyone know that Is it possible, the whole dialogue is b Defense is again being made to scratch? You can style buttons in themes with attributes: Android: Button Barcode button button style , android: buttonBarNegativeButtonStyle , and android: buttonBarNeutralButtonStyle .

loopbackjs - loopback reference to a model -

I am trying to refer to a model in the first save function of another model using this documentation: And it does not seem to work. I am forgetting something, can anyone help? (model1.js) var loopback = expected ('loopback'); Var app = module Exports = Loopback (); Module.exports = function (model 1) {Model1.beforeSave = function (next, obj) {if (obj.relation ()) come back (); Console.log (app.models.Model2); //the upcoming(); }}; ignoring the "relationship" part of your sample, here it is How your code should look ... module.exports = function (Model1) {Model1.beforeSave = function (Next, obj) {// if (obj.relation ()) next ( ); Console.log (Model1.app.models.Model2); // or console.log (Model1.app.models ('Model2')); Next (empty, OBG); // "zero" = "no error" and you can modify the oboes in some way above}};

c# - Sort a Grid when after loading all data in the grid -

I have a grid with 4 columns 'id' name 'address' and all the IDs in the list and grid For binding Now I am getting the name based on the ID of the grid_item databout event, the address age for that particular line I now want to sort the grid by name. How can I sort by name, which was tied to the grid in the item Dathbong My code grdEmployee.DataSource = lstEmployee.OrderBy (x = & Gt; x.Id) .toList (); Protected Zero grdEmployee_ItemDataBound (Object Sender, EventArgs e) {label lblname = (label) e.Row.FindControl ("lblName"); Label llge = (label) e.ro.fund control ("lllage"); Labeled LLLID = (label) e.ro.fund control ("LBLID"); LblName.Text = GetName (lblId.Text); LblAge.Text = GetAge (lblId.Text); } Note: This is the sample code that I myself have written in this editor. Please do not mind the flaws in the code and please understand my scenario. I think it would be better if you get all the data in one go, then every Pa...

Display where function is called from not where it is defined console javascript -

I'm a lazy developer ... I like to make shortcuts, so I get console.info to c /*core_functions.js*/ / * ============================ == ==================== Bind C to be alert on the mobile console in the desktop.log ================ ================================== * / window.c = False; If (type of console === "object" & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; ;; SP.isMobile) {c = function (msg) {console.info (msg); }; } And {c = function (msg) {debug}; }; } /*somefile.js*/ c (anObject); I have been experimenting this for some time and some have always offended me, it displays the file in which the function is defined, from where the function is called : core_functions.js: 40 object {stadium name: "stadium 3", pitc...

arrays - How To Sort Empty key & value in lower order if its null in php -

what do i want I need it when [comment] = 'field tap Then it should be sorted & amp; The result will be in the following order. array structure [0] = & gt; Array ([type] = & gt; CACDAA [Metadata] => Array ([0] => Hey ([zodiac] => 320 [comment] = & gt;))) [1] = & gt; ; Array ([type] = & gt; CVMA [Metadata] => Array ([0] => Hey ([zodiac] => 320 [comment] = & gt; Onsite, after 20 February) )) source code unset ($ data [0]); // Store Types and Areas are related to foreach (dollar data $ k => $ v) {$ type [$ v ['type']] [] = $ k; } // loop type, result array foreach ($ type = $ k => $ v) {$ tmp = array ('type' = & gt; $ k, 'metadata' => array ()); // loop this type of foreach ($ w as $ w) {// store in TMP $ t = array ('amount' => $ data [$ w] ['amount'], 'comment' = & Gt; $ data [$ w] ['comment']); $ T Array structure array ([zodiac] => 320 [c...

.net - Add users to System.Activities.DurableInstancing roles -

We have a lot of customers connecting to SQL Server using db_datawriter and db_datareader roles We still have no Flexible roles were not. Now our software uses the new workflow FatAtian firmness store. System.Activities.DurableInstancing and to enable li> System.Activities.DurableInstancing.InstanceStoreObservers System.Activities.DurableInstancing.InstanceStoreUsers System.Activities .DurableInstancing.WorkflowActivationUsers user db_datawriter and db_datawriter roles only get SqlException: Execution permission objection The 'CreateLockOwner' database was denied on 'mydatabase', schema 'System.Activities.DurableInstancing'. This is the software that starts in store.Execute: Installel Handle = store.CreateInstanceHandle (); Var createOwnerCommand = new CreateWorkflowOwnerCommand {InstanceOwnerMetadata = {{XNWorkflowHostTypePropertyName, New InstanceValue (XNWorkflowHostTypeIdentifierName)}}}; View Instance View = Store. Exe...

what is "this" in setOnClickListenner in Android -

I am new to Android and I know that this is a very common question. I tried to find the answer, but did not satisfy my curiosity. It is believed that in order to define the audience for a button in Android I have the code below. I am still confused about it. I know "this" refers to the current example but in this case, what does "this" represent? Does this example indicate btnSave or other objects? Why this argument can change (New OnClickListener ()) It has been assumed that I have two identical buttons. How do I know the on-click method that is clicked on ??? Can anyone explain the purpose of "this" in a wider state? find button BTNS service = (button) VVBIID (RBTN service); BtnSave.setOnClickListener (this); Click Public Zero (see V) {// do something here} here , refers to the context of the current object, the container in which btnSave in this code was the purpose that the container be on the click button The listener will listen to...

order - R - Rank Largest to Smallest -

I used rank () to specify the value of the rank for a dataframe I need it, though I need it rank1 = highest and not least 1 = if you

javascript - dispatchEvent not triggering jQuery.on() event listener -

I have the following code that triggers custom name events: elem.addEventListener ('Click', function (event) {event.preventDefault (); // some processing content var event = new event ('custom_event'); this.dispatchEvent (event);}); If I try to capture custom events with jQuery.on (), then it works, but only when I'm not using the Dynate Selector filter. Then it works: $ ('selector'). ('Custom_event', function () {// works}); but not so: $ (document) .on ('custom_event', 'selector', function () {// does not work}); Can anyone put light on it? Here is the problem showing. is not the event bubble by default, so when you create an event, The form needs to be passed in the form of bubbles: true that you want to bunk the incident. You can use to do this. If you are using Event Delegation to register event handlers, use Event Bubbleing to work. document.querySelectorAll ('.button') [0] .addEventLi...

video - How to access compressed stream from webcam with ffmpeg -

I want to stream live webcam with ffmpeg. The output stream of raw and compressed data in my Logitech c920 webcam ffmpeg -f v4l2 -list_formats all -i / dev / video1 produces the following console output: [video4linux2, v4l2 @ 0x26709e0] Raw: yuyv422: YUV 4: 2: 2 (YUYV): 640x480 160x90 160x120 176x144 320x180 320x240 352x288 432x240 640x360 800x448 800x600 864x480 960x720 1024x576 1280x720 1600x896 1920x1080 2304x1296 2304x1536 [video4linux2, V4L2 @ 0x26709e0] Compressed : h264: 264: 640x480 160x90 160x120 176x144 320x180 320x240 352x288 432x240 640x360 800x448 800x600 864x480 960x720 1024x576 1280x720 1600x896 1920x1080 [video4linux2, V4L2 @ 0x26709e0] Compressed: mjpeg: MJPEG: 640x480 160x90 160x120 176x144 320x180 320x240 352x288 432x240 640x360 800x448 800x600 864x480 960x720 1024x576 1280x7 20 1600x896 1920x1080 I would like to image a compressed H264 image and send it to ffserver. When I use this command ffmpeg -r 25 -f v4l2 -i / dev / video0 -C: VGD 264-B: V 2500k ...

ios - Coredata and automatic sorting of relationships -

I have a managed object tour that has many points when I load points to show them in a table , Then I use my data as tour point. Each point has a field 'level' in which it shows the order in which they should be visible. How can I create tour.points to sort myself according to point.pell? Should I give a different description, or is there any direct way? The best way to populate a table view with core data is to have a NSFetchedResultsController Is. The FRC has a fetch request in which you can attach an ingenious and sort discriptor. There are some easily available sample codes that you can copy from Xcode template when checking "Use core data". In the Faxed result control construct method, add predicate and sort discriptor. I am assuming that you are bringing an institution called point , which is related to excursion . fetchRequest.predicate = [NSPredicate PredicateWithFormat: @ "tour =% @", tourObject]; FetchRequest.sortDescriptors...

javascript - Event tracking on a subdomain (already with extra parameters) - Universal Analytics -

हम एक तत्काल पहुँच प्रदान करते हैं जो स्वत: उपयोगकर्ताओं को एक डेमो अकाउंट (हमारे सीआरएम सिस्टम के) में लॉग करता है। मैं घटना और amp का उपयोग कर रहा हूँ; Google एनेलिटिक्स में कनवर्ज़न ट्रैकिंग, जब यह ट्रिगर करने के लिए: के बराबर वर्ग: त्वरित-एक्सेस एक्शन के समान: इंस्टेंट-एक्सेस-साइन-अप के बराबर लेबल: इंस्टेंट-एक्सेस-साइन-अप वैल्यू बराबर प्रति: 35 मूल लिंक ऐसा दिखता है: https://secure.workbooks.com/login?demo=1 इसलिए मैंने जो लिंक बनाया है (ट्रैक पर लिंक पर जोड़ा गया इवेंट ट्रैकिंग) है: > https://secure.workbooks.com/login?demo=1?onClick= "ga ('भेजें', 'घटना', {eventCategory: 'त्वरित-पहुंच', ईवेंट एक्शन: 'इन्स्टंट- प्रवेश-साइन-अप ', इवेंट लेबल:' इंस्टेंट-एक्सेस-साइन-अप ', इवेंट वैल्यू: 35 हालांकि यह काम नहीं कर रहा है। कोई भी विचार है कि यह क्या नहीं है काम कर रहे हैं? मैंने अपने लिंक्स को कोड के रूप में प्रदान किया है, क्योंकि वे लिंक के रूप में कोई मान प्रदान नहीं करते क्योंकि हम लिंक मापदंडों का अध्ययन कर ...

c++ - Cocos2D X: How to check if a key exists for a plist file? -

I am using the following code to read data from my game plist: int LevelNum = SOME_VALUE_FROM_OUTSIDE; Manmap mapfile = filesutils :: meet () - & gt; GetValueMapFromFile ("LevelDetails.plist"); Std :: string strLevel = std :: to_string (levelNum); Valuemap Map Level = Mapfile (Stellwell) .asValueMap (); LevelDetails.plist is a plist with the dictionary as root. The problem is that there may be occasions where no name is levelNum / strLevel. So I have to check that the key exists before I run this line: map map = mapFile.at (strLevel) .asValueMap (); // Sometimes If the exception is thrown, what is the proper way to check if a key named levelNum / strLevel is present or not? Because ValueMap is a std :: unordered_map, you can use methods of that class: if (mapFile.count (strLevel) .count ()> gt; {Manmap Maps = mapfile.tr (strLevel) .asValueMap (); } The Valmax announcement in Cocos 2D X is: typedef std :: unordered_map & lt; Std :: strin...

javascript - Formatting JSON output in NodeJS -

इस सवाल का पहले से ही एक उत्तर है: 4 जवाब मेरे पास कोड का यह टुकड़ा है एक डेटाबेस को क्वेरी करने और JSON प्रारूप के रूप में जानकारी के लिए जिम्मेदार: connectionpool.getConnection (फ़ंक्शन (गलती, कनेक्शन) {if (err) {console.error ('कनेक्शन त्रुटि:', त्रुटि ); Res.statusCode = 503; res.send ({परिणाम: 'त्रुटि', err: err.code});} अन्य {connection.query (क्वेरी, फ़ंक्शन (गलती, पंक्तियाँ) {if (err) {console त्रुटि (गलती); res.statusCode = 500; res.send ({परिणाम: 'त्रुटि', err: err.code }); } अन्य {res.send ({json: पंक्तियाँ}); } Connection.release (); }); }}); आउटपुट निम्न है: {"json": [{"id": 39 937, "ट्रांसक्रिप्ट_लिअस": "AC148152.3_FGT007", "अभिव्यक्ति": 0, "ऊतक": "पत्ता", "स्थिति": "कोई तनाव"}, { "id": 39,941, "transcript_alias": "AC155352.2_FGT012", "अभिव्यक्ति": 0.217, "ऊतक ":" पत्ता ","...

c++ - Conversion from ‘callback<void>::func*’ to non-scalar type ‘callback<void>’ requested error when using g++ 4.8.3? -

To understand the templates and function objects of C ++, I want to create a template class callback, which is a type that is approximate approximation of curry action. The purpose of the type is callback & lt; R, b1> has a member R operator () (B1) , thus the callback function objects, which specify the return of the first template type, the function and the remaining arguments which pass the function To specify the type of arguments to do. By using this method but when I used the following code to create an example and compile it, I found an error: template I found an error when compiling: forstack.cc6: 65: error: conversion from 'callback'; Zero & gt; :: func * for 'non-scalable type callback & lt; Zero & gt; The requested callback & lt; Zero & gt; Cb0 = Callback & lt; Zero & gt; :: init (printmsg, "dillon \ n"); What knowledge do I need for this problem? Thanks! EDIT: According to the answer from @Dennis-B and...

php - Secure paypal form submition -

I am trying to create a payment system which is using a PayPal form. The problem is that people can click on "View the details of the element" in their browser, and edit the rewards, and such as in the html How do I stop it? I thought about placing a form on any other site that instantly submits it, but I do not want to use javascript because some people have not turned it on. You can do this by which a is a messaging service that informs you of events related to PayPal transactions. To automate office and administrative functions, you can use the IPN message, like completing orders, tracking customers, and providing information related to the situation and other transactions. The second option that helps you to create encrypted buttons. Please take a look and for more information.

angularjs - find last 4 digits of a given number using Angular js -

I have a 10 digit telephone number, I need to use the last 4 digits of a given number of Angel JS. Is there a way to find the given number? Example: 9916983265 If your telephone number is a string var telNb = "9916983265"; Var last4Digits = telNb.substring (telNb.length-4, telNb.length); If your telephone number is an integer: var telNb = 9916983265; Var previous 4 digits = telnb% 10000;

AngularJs controller, wait for service $http result -

Before the rest controller, I want to wait for a service $ http result. I have some hard work JSON And it is visible in the controller, but as soon as I try to populate my data with a $ http request, the controller is not waiting for it and just walks through the rest of the code. Chrome is showing the expected result for the Network tab request from webdeveloper. I already have the following: var ListerApp = angular.module ('ListerApp', ['ListerApfilter', 'Shared Factor App', ' Shared Services', 'ListerApus Controller', 'Infinite Scroll', 'Connection-Inview', 'NGRUTU']); ListerApp.config (['$ routeProvider', '$ httpProvider', function ($ route provider, $ location provider) {$ routeProvider. When ('/ list', {templateUrl: '/assets/services/partials/list.html' Controller: 'Lister Ctrl', Resolve: {'sharedServiceAppData': function ($ sharedServices) {// SharedFactoryApp...

java - How would I let my main method access the paint method I created inside Applet? -

Hello Paint Class is how I would like to use the main variable. How do I do this? I would like to move the variable so that I can make conditional to draw strings when estimating correct or false characters. Import static java.lang.System. *; Import javax.swing *; Import java.util. *; Import java.io * *; Import java.awt. *; Import java.applet. *; Import static java.lang.System. *; Public class testing applet {public static expands Zero main (string [] args) throws IOException {JFrame jp1 = new JFrame ()); A test = new test (); Jp1.getContentPane (). Add (a, BorderLayout.CENTER); Jp1.setSize (new dimension (500,500)); Jp1.setVisible (wrong); Random random = new random (); Scanner Scanner = New Scanner (New File ("C: \\ User \\ s612153 \\ Documents \\ Java Files \ words.");); ArrayList & lt; String & gt; Array list = new arreelist & lt; String & gt; (); ArrayList & lt; String & gt; Array = new arreelist & lt; String & gt; (); ArrayList ...

java - Retaining data in Apache Kafka -

I have just started reading Apache Kafka a few days ago, so I am a kind of newbie in this technique. There are some doubts / questions and need to get an explanation. I like: According to the configuration: log.retention.hours Here we set the duration in hours can do. Can data retention time be extended up to 2 years? Accordingly, it says: The Kafka cluster retains all published messages. Whether they are used for a configurable period of time or not. For example, if log retention has been set for two days, after two days of the message it is available for consumption, after which it will be discarded to free up space. Performance of Kafka is consistently consistent with the size of the data, so maintaining too many data is not a problem. Because it already says Completion is static in relation to the data size So does this mean that we store as much data as possible can do? Does it require some additional configuration or monitor? 1) Surely log.retention.hours is ...

sql - SELECT only those columns, where values are NOT NULL -

I have a selection statement (using the function), which gives 60 columns and approximately 10000 lines, some of these columns There are only zero values ​​- I want to exclude them from selection. Is there any way to do this? The query is a bit complex, including the tabfunction function, but the results are very good: ------ - + ------- + -------- + --------- + --------- + ID Column1 | Column2. ... | Column 60 | -------- + ------- + -------- + --------- + --------- + 1 | 1 | Faucet 52.5 | 15 | ... | ... | ... | ... | ... | 10000 | 2 | Faucet 87.5 | 3 | -------- + ------- + -------- + --------- + --------- + In this situation I do not want to select column 2. is the query: select to dma.ct_fafajkod_pont ('select one, .pont, a.faj, a.tom (select f.ppont_azon pont, fl .mezonev faj, case WHEN f.tom08 :: integer = 1 then 2.5 WHEN f.tom08 :: integer = 2 again 12.5 WHEN f.tom08 :: integer = 3 then 35 WHEN tom08 :: integer = 4 then 75 and 0 ed + Case WHEN f.tom920 :: inte...

autohotkey - Substitute AltTab in one key -

Is it possible to change AltTab with only one key press? I tried this one but it does not work `: AltTab I use it, you may need to change sleep delay. `:: Send {Alt Down} {Tab} Sleep 100 {Alt Up} Return I have Windows 8.1 64-bit and AutoHotkey v1.1.16 Running .05. And my C: \ Program Files \ AutoHotkey \ AutoHotkeyU64.exe is digitally signed by signing script (so that) so that it can allow windows to emulate Alt + Tab. Digital sign is required if you are using Windows Vista and beyond. Download the zip file and remove it. Then run EnableUIAccess.ahk : It will ask which auto-executable signature will be the one you want ( AutoHotkeyA32.exe , AutoHotkeyU32.exe , AutoHotkeyU64.exe or AutoHotkey.exe ). Then he will ask to save the new executable. You can overwrite the original file or save it as other executable. In the end it will say "menu " menu item with run script with UI access if you choose 'yes', then you can write the .hk file...

html - Dynamic CSS where the number of elements is variable -

Then I have some code that creates a table (although do not use table tags because it will definitely be wrong !) Where each line is once a color that is colored based on the percent it is currently using inline styles as you can see below (using the smart template system). I want to move these styles into the stylesheet, but I'm not sure how I can make the classes dynamic because I do not know how many rows will ever be. & lt; Div class = "fullbar" & gt; & Lt; Div class = "bar" & gt; {If $ per response [all] Restrictions eq 0} & lt; Div class = "innerbar allna" style = "width: 100%;" & Gt; & Amp; Nbsp; All responses n / a & lt; / Div & gt; {Elseif $ reactions [all] .score lt $ stop withLeo} div class = "innerbar shortbar" style = "width: {$ stop below * 10}%;" & Gt; & Amp; Nbsp; Banned - Under $ $ {offholdBelow} & lt; / Div & gt; {Else} {If $ reactions [all] .re...

c++ - Pass overloaded member function to a variadic template function -

मेरे पास फ़ंक्शन जोड़ के साथ एक वर्ग है: कक्षा पूल {सार्वजनिक: पूल () {}; टेम्पलेट & lt; कक्षा F, कक्षा ... A & gt; ऑटो जोड़ (एफ एंड amp; एफ, ए और amp; ... args) - & gt; Std :: भविष्य & lt; typename std :: result_of & lt; एफ (ए ...) & gt; :: प्रकार & gt; {// रिक्त प्लेसहोल्डर को इस कोड के उदाहरण के लिए, उदाहरण के लिए std :: future & lt; typename std :: result_of & lt; एफ (ए ...) & gt; :: type & gt; सेवानिवृत्त; रिटर्न रिट; }; }; इसे किसी भी कार्य को उसके तर्कों के साथ लेना चाहिए, इसे थ्रेड पूल में जोड़कर उस फ़ंक्शन के परिणाम प्रकार के भविष्य को वापस करना होगा। और एक वर्ग जहां मैं इसका प्रयोग करें: वर्ग MyClass {सार्वजनिक: स्ट्रिंग doIt (स्ट्रिंग) {रिटर्न स्ट्रिंग ("a"); }; स्ट्रिंग doIt (int, string) {वापसी स्ट्रिंग ("b"); }; शून्य परीक्षण () {पूल myPool; स्ट्रिंग ए ("टेस्ट"); MyPool.add (& MyClass :: doIt, ए); // त्रुटि}; }; जो एक कंपाइलर त्रुटि देता है: त्रुटि 1 त्रुटि C2914: 'पूल...

java - Check if incoming call was missed -

"postprint" itemprop = "text"> I have registered for a broadcast receiver incoming call event states and I'm sure the incoming call passes a missed call to want to be had as the challenged to reject calls I get to CallLog provider to receive calls the latest device and I compared it with CallLog.Calls.MISSED_TYPE. The problem is that the CallLog provider has been updated with the last call that was received by the device ... This is why I am using sleep on the receiver thread, which means my receiver waits for the CallLog provider It may be updated before these questions can be updated, as you can see below: Private boolean isMissedCall (reference reference) {// preceded position on a global if (previousState = Null & amp; amp; ; PreviousState.equals (RINGING)) {// It is Dental !! Try {Thread.Sleep (2000); } Grip (Interrupted e) e.printStackTrace (); } String call type = android.provider.CallLog.Calls.TYPE; String call new = android.provir Call log...

Dropwizard View includes several Freemarker templates -

I use the scene with Freemarker to display HTML information pages. Now I want to add a "footer" to all the templates, but every * me. The FTP file does not have to copy the same code. Is it possible to create a footer? Ftl and add it to all others *. Ftl files? In search of the web, I found Freemer Macros, but I do not know how to use it in DW. How can I use freeware macros with DW? This does not help -> Added: & lt; P & gt; & Lt; #include "footer.ftl" & gt; & Lt; / P & gt; This file is in the same folder (I've tried other places) and contains footer text in it: Copyright 2001-2002 & lt ; Br> All rights reserved.

python - Why does uncaught exception get logged to Sentry twice? -

I was testing that the exception in my flask app will be logged in Senty and it must be seen that the only exception is always Logged twice, clearly why a different stack trace happens and how should I stop it? For the first entry, I am getting the following stack trace: file "raven / middleware", line 35, line 1820, __call__ iterable = self.application ( environment, start_response) file "flask / app.py", = self.make_response (self.handle_exception (e) in wsgi_app response) file "flask / app.py", line 1403, handle_exception reraise (exc_type, exc_value, TB) File "floppy / app.py", line 1817, wsgi_app in response = self.full_dispatch_request () file "flask / app.py", line 1477, full_dispatch_request RV. In = self.handle_user_exception (e) File "flask / app.py", line 1381, handle_user_exception reraise (exc_type, exc_value, TB) file "flask / app.py", line 1475, in full_dispatch_request RV In = self.dispatch_r...

javascript - Checking argument names inside a function -

Is there a way in javascript to check any logic identifier name inside the function ??? For example: var config = function (callback) {if (callback.definedArgumentName == 'argumentName') // something to do}; Config (function (argumentName) {// do something}}; I'm asking if there is something that can be called -backback. DefinedAmergetameName - can be transformed into this example. So I posted this question because I wonder how in AngularJ they used to be an administrator Orders and controllers recognize the names of the controllers specified in the definition. The reply of Temu can be correct, I I have given advice and obviously you do not need any functionality. I have made an example: var services = {'$ scope': 'This is scope service', 'MyService ':' This is your own service. '}; Function controller (callback) {var args = callback. Strothing (.) Partition (' ('); Argus Plus (0,1); Args = args. Join Args = args.jo...

algorithm - Java finding full routes in NxN grid -

इस सवाल का पहले से ही एक उत्तर है: 5 जवाब इसलिए मैं बनाने की कोशिश कर रहा हूँ NxN ग्रिड में पूर्ण पथ खोजने के लिए एक एल्गोरिथ्म उदाहरण के लिए 1x1 ग्रिड में 1 संभव पथ है, 2x2 ग्रिड में 1 है, 3x3 में 2 और 4x4 में 8 है। यह विचार है परिदृश्यों को खोजने के लिए जहां हम ग्रिड के प्रत्येक स्थान को स्थानांतरित कर सकते हैं। मैंने नौकरी के लिए एक रिकर्सिव फ़ंक्शन बनाया है और यहां कोड है: सार्वजनिक स्थिर int getRoutesHelp (int [] [] तालिका, int x, int y) {if (एक्स> टेबल: लैंग-1 || एक्स & लेफ्टिनेंट; 0 || वाई एंड लेफ्टिनेंट; 0; y & gt; टेबल। लांति-1) 0 लौटें; यदि (सारणी [x] [y] == 1) 0 लौटा; तालिका [x] [y] = 1; अगर (आईडडईड (टेबल, एक्स, वाई)) (यदि (हैटेबलफुल (टेबल)) 1 रिटर्न; } Else {int a = getRoutesHelp (तालिका, x-1, y); Int d = getRoutes सहायता (तालिका, एक्स, वाई + 1); Int b = getRoutes सहायता (तालिका, x + 1, y); Int c = getRoutes सहायता (तालिका, एक्स, वाई -1); वापसी + a + b + c + d; } वापसी 0; } सार्वजनिक स्थिर इंट्रेट्सट्राउट्स (पूर्णांक आकार) {int [] [] तालिका = न...

java - Stoping and starting a new thread after timer expires -

This is my first post overflow stack and obviously I do not have much knowledge about thread. It has a console app and thing, when the main method starts, the timer starts and my program is implemented, it includes getting information from the keyboard and it works very well. After the timer expires, 20 seconds, it shows the call run () from the reminder task and shows the number of points that I am gathering during that time. Now after that I myself Want to make the app, the main method to start or not start the option again. Talk My main will still gather information from the keyboard which is still executed and not running by the input method which I want. If I have put System.exit (0), of course I can not start a new thread after that. How do I pass it, in my time, there is a way to say "unless my timer expired"? or something else? Fixed class reminder tickrask {Public runs zero () {Four answers; System.out.println ("Time has expired!" + Your re...

c# - XElement.SetElementValue overwrites elements -

मेरे पास निम्न संरचना है: & lt; रूट नाम = "जैक" & gt ; & LT; Ele1 & gt; 4 & lt; / Ele1 & gt; & LT; Ele2 & gt; 4 & lt; / Ele2 & gt; & LT; Ele3 & gt; 4 & lt; / Ele3 & gt; & LT; Ele4 & gt; 4 & lt; / Ele4 & gt; & Lt; / रूट & gt; मैं कुछ मानों को संशोधित करना चाहता हूं ताकि मैं निम्नलिखित कोड का उपयोग कर सकूं: XElement root1 = नया XElement ("रूट"); रूट 1 .सेट ऐटिट्यूवल ("नाम", "जैक"); रूट 1 .सेट एलेमेंटवॉल्यू ("Ele1", 1); Root1.SetElementValue ("Ele2", 2); रूट 1 .सेट एलेमेंट वैल्यू ("एले 3", 3); इसका नतीजा एक नई संरचना है: & lt; रूट नाम = "जैक" & gt; & LT; Ele3 & gt; 3 & lt; / Ele3 & gt; & Lt; / रूट & gt; यदि मैं Ele1 के मान को सेट करने के बाद रूट 1 डीबग। लॉग (रूट 1) प्रिंट करता हूं: & lt; रूट नाम = "जैक" & gt; & LT; Ele2 & gt; 2 & lt; / Ele2 ...

elasticsearch - Why am I not able to query by geolocation in elastic search? -

So I'm experimenting with elastic search and that's what I did. 1) A geo-map mapping was added to my index named "test" curl -XPOST localhost: 9200 / test -d '{"mappings": {"Type1": {"_source": {"enabled"}: "properties": {"location": {"type": "geo_point", "index": "not_analyzed"}}}}} ' 2) A document was indexed under the test: curl -XPUT 'localhost: 9200 / test / type1 / 1? Beautiful '-D' {"Location": {"3) Then a question was written by geographical location filter like this: curl -XPOST '' host: 9200 / test2 / _search Beautiful '-d' {"filtered": {"query": {"match_all": {}}, "filter": {"geo_distance": {" I get this for: "200 kilometers", "space": {"lat": 40, "Lo N": -70}}}}} / P> "error...

Why isn't my decimal to binary converter working in python? -

यह मेरा कोड है: dec = int (इनपुट ("lol")) एक = [] जबकि डीसी> 0: शेष = दशमलव% 2 यदि शेष है; gt; a.append (1) dec = dec-remainder else: a.append (0) dec = dec-remainder bn = ''। जब मैं चलाने के लिए पूर्णांक में टाइप करता हूं और उसके बाद कुछ भी नहीं आता। 1) टाइप करें: आपकी अंतिम पंक्ति को निश्चित रूप से प्रिंट (बीएन) होना चाहिए प्रिंट (बाइनरी) 2) लूप लटकी हुई है: आप कभी भी rightshift & gt; / डिवाइड-बाय-टू डीसी पर नहीं करते हैं, इसलिए आपका लूप कभी समाप्त नहीं होता चूंकि आप एक बदलाव करने जा रहे हैं, आपको स्पष्ट रूप से शेष घटाना नहीं चाहिए, यह सिर्फ सही स्थानांतरित हो जाएगा (देखें नोट ए)। आप इनमें से कोई भी कर सकते हैं: dec = dec> & gt; 1 डीसी> & gt; = 1 # भी गुप्त, चूंकि & gt; & gt; एक असामान्य ऑपरेटर 2b) बग: आपको a या के उत्तरार्द्ध अंक जोड़ने की बजाय, प्रीपेड की आवश्यकता है बीएन । वैसे भी कॉम्पैक्टिटी के लिए यहां एक पूर्ण पुनर्लेखन है; हम a सूची के साथ वितरित कर सकते हैं और मौजूदा स्ट्रिंग bn पर सीध...

vb.net - Replace text in a file? -

मैं एक फ़ाइल में सफलतापूर्वक एक पाठ को बदल रहा हूं। मंद fileReader as String = My ("सी: \ test.txt")। बदलें ("foo", "bar") My.Computer.FileSystem.WriteAllText ("C: \ test.txt", fileReader, False) लेकिन अगर मैं पाठ के बीच में नहीं जानता, तो मैं कैसे बदल सकता हूँ? उदाहरण के लिए example_my ("browser.taskbar.lastgroupid", "E7CF176E110C211B"); E7CF176E110C211B कैसे बदलें? एक तरीका RegEx का उपयोग करना है आप पहले और अंतिम भाग निर्दिष्ट कर सकते हैं और फिर किसी भी हेक्स नंबर से मेल करने के लिए \ d + या बेहतर [0-9A-F] + का उपयोग कर सकते हैं। इसलिए दिए गए भाग जिसे आपको नहीं पता है वह हेक्साडेसिमल संख्या है, आप निम्न कोड का उपयोग कर सकते हैं: मंद fileReader के रूप में स्ट्रिंग = My.Computer.FileSystem.ReadAllText ("C: \" Test.txt ") fileReader = System.Text.RegularExpressions.RegEx.Replace (fileReader," [0- 9A-F] + "," bar ") My.Computer.FileSystem.WriteAllText (" C: \ te...

SQL Server Spatial Types -

I am trying to create a SpatialObject in C # and it has its own SQL Server database I am passing through A DataSet , but I can not understand how I can pass it to DataSet : / when I try to add element to the parameter I do not know anything about it, but I do not know anything about it. I do not get anything in the form of DS. It is only found in the form of the ultimate. Kanva (geography, '') Can I pass DS or should I do this through any stored procedure? Here is a part of my code that I am using SqlGeographyItem.BeginGeography (OpenGisGeographyType.Point); String Radio Latlang = Points Remove (points. Length - 1); String [] token = radiot label.plit (','); Decimal Tree Mercury (Hidden Radio Price, Outside Radio); SqlGeographyItem.BeginFigure (Convert Repeat (token [1]), Convert. Repeat (token [0])); SqlGeographyItem.EndFigure (); SqlGeographyItem.EndGeography (); SqlGeographyFig = SqlGeographyItem.Constructed geography; SqlGeographyFig.STBuffer (C...

Ruby on Rails: Rendering element tags with html options if attribute is present -

I'm trying to present a label with an HTML attribute data-color , But only if an object attribute is available This is what I have, but it is not presenting the label that I believe because it is saying that the attribute is not available, so the label Do not show attribute: f.label: value, choice.label, category: 'fs-button', data_color: choice.color if Choice.attribute_pres Ent? : Color If I present the object attribute, how do I set the html attribute data-color ? If the property does not exist then the data-color attribute should not be visible at all.

php - Unable to load dynamic library '/usr/lib/php5/20090626/svn.so' -

After installing prerequisites, run this command on Ubuntu 11.10 php -V receives the following error: PHP Alert: PHP startup: Dynamic library '/usr/lib/php5/20090626/svn.so' load Unable to do - Libsvn_client-1.so.0: Can not open the shared object file: There is no such file or directory in the unknown in the line I /etc/php5/conf.d Has commented the following line from /svn.ini, which Shcit paused the error. However I would still like to know what to do to solve this error to include the extension? extension = svn.so Thanks! You first need to install the package: sudo Install apt-get php5-svn

html - Height: 100% Not Working Even Though All Parents Have Height: 100% -

सेटिंग ऊंचाई: 100% के लिए & lt; div & gt; नीचे दिए गए HTML में .ui सभी पैरेंट तत्वों में height को 100% पर सेट किया गया है। क्या ऐसा हो सकता है क्योंकि मैं & lt; कोर-हेडर-पैनल & ​​gt; का उपयोग कर रहा / रही हूं? मैंने अपने कोड की जांच की, लेकिन मुझे कुछ भी दिखाई नहीं देता जो ऊँचाई ओवरराइड हो। क्या यह लेआउट क्षैतिज गुणों का उपयोग करने के कारण हो सकता है? लेआउट विशेषताओं (शीर्ष पर निर्मित) और core-header-panel का हिस्सा हैं। यह HTML है (सरलीकृत): & lt;; doctype html & gt; & LT; html & gt; & Lt; शरीर अनसुलझे & gt; & LT; कोर हेडर पैनल & ​​gt; & Lt; div लेआउट क्षैतिज वर्ग = "कंटेनर" & gt; & Lt; div class = "ui" & gt; & Lt; / div & gt; & Lt;! - यह ऊंचाई का 100% नहीं लेता है - & gt; & Lt; div फ्लेक्स वर्ग = "आइटम" & gt; & Lt; / div & gt; & Lt;! - इसमें इसकी सामग्री है जो ऊंचाई भरती है, लेकिन & lt; div & gt; खुद नहीं करता - ...

ruby - Delayed_job crashing Heroku worker (YAML issue?) -

I am running on a strange issue which is causing my harrowing workers to crash. We are using delayed_job for Ruby and background jobs on the railways I am giving a job to work late by using. This is the call that I make to "recognize" the user: after_save {self.identify! } Then it puts a job in the queue that looks like this: : Worker :: User :: TrackApi Domain: https://api.getvero.com Options :: Email: ******@gmail.com: Data :: Email: ******@gmail.com : Name :? ? : First name:? :last name: ? This issue is one of those question marks: I'm not sure why they appear there instead of a string of text, it's an error that comes: Psych :: SyntaxError: (& lt; unknown & gt;): Mappings on line 7 column 14 are not allowed in this context Unfortunately , Are just failing instead of a job .. it actually crashes the worker .. the order to process other tasks Process is not perfect. Has anyone participated in the past on this issue? How can I format YA...

c++11 - How to implement templated function with "subtemplated" -

After I have a function which is declaration in the template's & lt; Typename t & gt; T obtained (int x); What do I want to achieve is a version where the return type is to apply a templated square (aka chrono :: time_point) I tried Templates & lt; Typename clock & gt; Std :: chrono :: time_point & lt; Clock & gt; Find (int x) {// execution} but it does not match with the announcement. What is the proper way to do this? You may not be partially expert of the function. You can do a function template through a special property / function object class, which you want. Namespace Details {Template & lt; Class T & gt; Get the structure {T operator () (int x) {// code}}; Template & lt; Class Watch & gt; Get structure & lt; Std :: chrono :: time_point & lt; Clock & gt; & Gt; {T = std :: chrono :: time_point & lt; Clock & gt; T operator () (int x) {// code}}; } Template & lt; Square T & gt; T...

php - Yii framework 2.0 ActiveRecord date not between two dates -

वाई फ्रेमवर्क 2.0 के साथ कार्य करना मेरे पास कॉलम 'from_date' के साथ एक डेटाबेस तालिका है और 'to_date' । मैं सभी अभिलेखों का चयन और गिनती करना चाहता हूं जहां: आज से_डेटा और to_date । और इन तिथियों के समकक्ष भी नहीं (! ($ $_date & lt; = $ today) & amp;! ($ $ & Lt; = $ to_date))) या प्रारंभ = "2"> से_डेटा नल और To_date नल है क्योंकि कुछ रिकॉर्ड में ये तिथियां रिक्त हैं, उन्हें चुना जाना और गिनती की भी ज़रूरत है। मेरे पास एक मॉडल है जो ActiveRecord वर्ग को बढ़ाता है, इसलिए मैं निम्नलिखित कोड को पुनः प्राप्त करने के लिए उपयोग कर सकता हूं डेटा: ModelClass :: find () - जहां ('बड़ा & gt; छोटा') - & gt; और जहां ('1 & lt; 2') - & gt; या जहां ('3 & gt; 1') - & gt; गिनती (); मैंने Yii 2.0 के दस्तावेज़ीकरण को पढ़ने की कोशिश की लेकिन यह समझ नहीं सका कि किस तरह का उपयोग नहीं किया जाए या समान संख्या का उपयोग न करें। शून्य के लिए, आप नीचे दिए गए कोड का उपयोग कर ...

android - How to use UsageStatsManager? -

background Google has disliked the function "" in the "ActivityManager" class, now all those Getting the list of apps that the current app has opened. I have also written a post about it, but I saw that it is impossible. The problem I have created a post about it (and, similarly, created by someone else), and requested it to reconsider, and Google A new class has decided to create similar functionality (like more data, but it can also be useful), but I can not know how to use it. The class is called "UsageStatsManager", and my guess is that the function "works" In addition, it seems that this is a new permission ("android.permission .PACKAGE_USAGE_STATS "), which is a system permit, but it is written that. Declaration of permission means intent to use APIs and the user's user settings can allow the application through the application. Another link about this new functionality I've found I have seen on t...

php - Creating systems with codeigniter and ajax-jquery -

I have a small social network for me and my friends and I always try to upgrade it and make it better I'm starting to "make" the ad algorithm to meet each other without "spy", I recently started to make my code more dynamic for a better user experience. For this, I tried to implement some jQuery, and as I was learning, I realized that I can do better and better, removing some dumb stuff at the beginning and Replace more semantic, safe and rational code. So, what should I know: is this jquery $? Post (); and / or $ is safe to use. and request a php page that uses this information to consult in the database? I mean, is there an easy way to get that type of code? The only sign in "social network" is that, I and my friends are starting to invite their friends that I do not even know this. I am afraid that over time, someone can represent any danger for my app because I do not have time / money to back up every day and spend the same way ... ...

sh - Bash convert string to timestamp -

मेरे प्रारूप में एक स्ट्रिंग है 20141225093000 जो का प्रतिनिधित्व करता है दिसम्बर 25, 2014 09:30 : 00 और मैं मूल स्वरूप को यूनिक्स टाइमस्टैम्प प्रारूप में कनवर्ट करना चाहता हूं ताकि मैं उस पर समय पर कार्य कर सकूं। मैं यह कैसे करूँगा? मैं आसानी से मूल्यों को पार्स कर सकता हूं expr के साथ लेकिन मैं उम्मीद कर रहा था कि YYYYmmddHHMMSS जैसे प्रारूप की पहचान करने में सक्षम हो और उसके बाद उस पर आधारित रूपांतरित करें। जीएनयू की तिथि के साथ, आप YYYY-MM-DDTHH: MM: एसएस युग का समय (1-1-19 70 के बाद से सेकंड्स) आसानी से बदल सकते हैं: दिनांक -d '2014-12-25T09: 30: 00' +% s यह किसी भी सीमांकक के बिना शुरू करने के लिए: में = 20141225093000 rfc_form = "$ {in: 0: 4} - $ {in: 4: 2} - $ {in: 6: 2} टी $ {in: 8: 2}: $ {in : 10: 2}: $ {in: 12: 2} "epoch_time = $ (दिनांक -d" $ rfc_form "+% s)

SentOnBehalfOf not working in Excel 2010 VBA Code -

I am working on a VBA script for mailings in Outlook 2010 through Outlook. Everything runs fine with one exception: .SentOnBehalfofName line will not work. Here is the full code All Mail () 'is working in Office 2010-2013 Dim OutApp as Out Output Applied Dim Outmail as Outlook Malatom dim dust strobes in the form of Outlook 'This is for the body email dim signature string as' This email is for signature, start the error again 'set outmail = nothing' set out = as worksheet set Nothing slow dim = shits ("mail") strobe = sh.Range ("C9"). Set the value out of the OutEp = Create Object ("Outlook.Application") OutMail = OutApp.CreateItem (0) Set up with MailCheck 'This includes email signature. Signature = Display with Mailmail With HTML Outbill. ' Display .. = Sh.Range "C5") .cc = sh Range ("C6") .bcc = sh Range ("C7"). Subject = sh.Range ("C8"). Value .HTMLBody = "& lt; br ...

xcode - How to know if predictive keyboard is ON/OFF in iOS8? -

Does anybody know if the future speaker keyboard is on / off in user settings? I thanks You must Follow UIKeyboardWillShowNotification . The value of the key UIKeyboardFrameEndUserInfoKey will be the frame of the keyboard regardless of its layout.

sql server - SQL Case statement not working -

I am writing a SQL query and it works, but I get only half results: (like Q1.VariableName when @Variablename IS NULL THEN ('E%') ELSE @Variablename END) What I want is: If the @VerbalName If not, q1 .VariableName = @Variablename. If it is zero, then 'q%' such as' e% 'or q1.VariableName such as q1.VariableName and' b1% 'is not like'% 1'VARIABLENAME '% MAIL%' But, I'm unable to get it. Does anyone tell me where I am going If you are doing this, then where section, you Case Completely: ((@Variablename IS NULL and (q1.VariableName 'e' 'or q1.VariableName such as' B% 'and q1.VARIABLENAME'% MAIL % ')) Or q1.VariableName = @Variablename) Since null is never equal to anything, q1.VariableName = @Variablename ) is always @Variablename null

php - Is it possible to $_GET without an ID? -

I have several pages that use $ _ GET , but only 1 ID is. For example / view / document / id = 1 I therefore use $ _GET ['id'] which is 1. Is it possible to do / view / document / 1 and if so, can it be $ _ GET ? I tried to search online but all I got was reported in sessions for some reason! Thanks You use the same way, but to match the URL You need to modify routing ... look up the tutorial to get an idea, because here's a little broad topic for example: etc. If these links If ever stop being available, then search for url routing or url rewriting . You just have to specify some rewrite rules, then it is good to go. If you later use some structure, then they do some stuff for you, but you have to specify some rules for routing in any way, so understanding the basics is a good idea. First is with .htaccess.

Can't get an image to load to a webpage using PHP with MySQl -

I have a few questions to answer. It is for the first time that when I loggedin.php If I log in to the page, then I can not do to populate images from MySQL. I'm getting a broken link. I have seen people ask this question, but I have done my page in such a way that when I saw it, I can not do it to work properly. > Second, in my $ UpdateQuery , I am not able to convert the image at all. I have seen it all around and whatever I found was a YouTube video that did not actually help me. Thanks in advance. & lt ;! DOCTYPE html & gt; & Lt; Top & gt; & Lt; Html & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; Untitled document & lt; / Title & gt; & Lt ;! - Latest compiled and minimal CSS dragged from bootstrap - & gt; & Lt; Link rel = "stylesheet" href = "http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" & gt; & Lt ;! - Optional topics pulled from ...

solr - Query to omit rows with empty records -

How do you eliminate rows with empty records in Solar? I have tried some permutations but nothing is working: 1: "John", "blue", "dog" 2: "litigation", "brown", "zebra" 3 : "Jane", "Green", "Cat" esp: [* TO *] is restricted to documents containing the esp fields, your query is Can be: q = esp: [* to *] and amp; fq = enu: open

javascript - Form not submitting on ENTER when no type="submit" element present -

We are using custom buttons to submit forms. One click event is assigned to submit a related form on .btn-submit. However, & lt; Button type = "submit" & gt; or & lt; Input type = "submit" & gt; element & lt; Form & gt; , either the user name or password does not submit the form by pressing ENTER in the text field. I still want users to type in a input & lt; Form & gt; HTML in the field without any type = "submit" code> & lt; Form action = "post.php" method = "post" & gt; & Lt; P & gt; & Lt; P & gt; Username & lt; / P & gt; & Lt; Input type = "text" name = "user name" style = "width: 300px; font-size: 18px" & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; P & gt; Password & lt; / P & gt; & Lt; Input type = "password" name = "password" style = "width: 300px; fo...

java - Return a void method using recursion -

I am trying to sort quick on the array of strings, but I did not know how to make an array of strings Returning to a zero method, PS: In the case only, I want to inform you that all other methods like swap and split have already been implemented and I do not think you have to see them. This is not the option to use any third party assistant libraries. public static string [] quicksort (string [] a) {int less = 0; Int high = a.length; Quicksort_lomuto (one, low, high); Return; // & lt; - This is the problem !!! What should I return? } Public static zero quicksort_lomuto (string [] a, int i, int j) {if (j-i & lt; 2) returns; Int k = partition_lomuto (a, i, j); Quartort_Lamoto (A, I, K); Quicksort_lomuto (A, K + 1, J); } If you have a zero return You can simply change the contents of the array while the array parameter has been passed from the value, this "value" is basically an indicator for the array, not the entire array of contents. An example: publ...

mongodb - How can I use consine distance with Local Sensitive Hashing? -

Given removed my item (document) characteristics (bag of Word), I want to implement a recovery solution . My solution prefers to use cosine distance with LSH. I searched the internet and documentation, but pre-built implementation in MongoDB could not get any trace for Netvai. Is there a way that applies to Mongodi? Or what's your alternative?

c# - Elasticsearch.net client can't do basic search -

I have a basic elastic search query that looks like this POST / fruit / _search {"query": {"word": {"name": "banana"}}} I have found the result, no problem when I understand So I try to do it in elasticsearch.net var requestBody = new {query = new {term = new} {name = "banana"}} }; Var Results = Client Search & lt; String & gt; ("Fruit", requestBody); And I did not get any results. If I have a new {} new search body, I get hit, but not filtered. What am I doing? Var query = new {query = new {term = new} {name = "banana"}} var json = for new elastic search (). Serializer.Serialize (query) .Utf8String (); This will be the result of the following json: {"query": {"term": {"name": "banana"}}} If you use Nest, the default behavior is for camel entering the property names (Nest's opinion): {"query": {"term": {...