Friday, 15 May 2015

algorithm - Find all the rows given the number of matching attributes and the query -


Below is my problem definition:

Looking at a database d, Are I looking at a query, which is a vector of standard attributes and the number of matches, k how to find all line IDs, such as the number of properties matched in the query is more or more efficiently?

The Easy Edition (I think) is that & lt; A vector of = m has been given -Certual attributes, how to find the AIDS of those rows; = Matches M-secretary attributes.

In some queries (for example), they need to scan the whole data in the query every time it comes in. I think it's not fast enough, I'm not really sure about the complexity on it.

If this is possible, then I want to avoid scanning all the rows in the database. Therefore, I am thinking of building some types of index, but I am thinking that there is no current work for them or not?

In addition, is it a similar problem and what is it called?

Thank you very much for your help.

(Regarding coding, I mainly use Python 2.7 for code 2).


hyperlink - jQuery tabs (clik on tab and link redirect) -


मेरे पास jQuery के टैब हैं

  & lt; div id = "tabs" & gt; & LT; ul & gt; & Lt; li & gt; & lt; a href = "# टैब -1" & gt; पहला & lt; / a & gt; & lt; / li & gt; & Lt; li & gt; & lt; a href = "# टैब -3" & gt; तीसरा & lt; / a & gt; & lt; / li & gt; & Lt; li वर्ग = "अंतिम" & gt; & lt; a href = "/ More.aspx" & gt; अधिक जानें ... & lt; / a & gt; & lt; / li & gt; & Lt; / ul & gt; & Lt; / div & gt; & LT; स्क्रिप्ट & gt; टैब्स ({fx: [{अस्पष्टता: 'टॉगल', अवधि: 'सामान्य'}, {अस्पष्टता: 'टॉगल', अवधि: 'तेज'}]})। AddClass ('ui- टैब खड़ी '); $ ("Li.last a")। Unbind ('click')। प्रत्येक (फ़ंक्शन () {this.href = $ .data (यह, 'href.tabs');}); & Lt; / स्क्रिप्ट & gt;  

यह jquery 1.7.2 में काम है, लेकिन 2.1.0 में नहीं ...

मुझे इस स्थिति में टैब पर क्लिक करने के लिए विकल्प चाहिए, जो कि कुछ लिंक पर पुनर्निर्देशित है सामान्य लिंक की तरह ... मुझे मिल रहा है:

/ अपरिभाषित और अधिक। एस्पैक्स पर रीडायरेक्ट की आवश्यकता

धन्यवाद!

<

आप इस बात को देख रहे हैं

  $ (function () {$ ("# tabs") .tabs (); $ ("li.last a")। Unbind ('click');});  

c# - Issue with datetime "String was not recognized as a valid DateTime" -


I am using the code below to check datetime and it is working fine in my machine, But once deployed, I am getting the

"The string was not recognized as a valid date time."

Please provide me the solution to work in all machines.

  DateTime1 = DateTime Pars ("16/05"); MM / DD string today's date = date time.Now Toaster ("MM / DD"); If convert (broken) (broken) (nowadays)> Convert. Tundetime (Date 1. Toastring ("MM / DD")) {// logic}  

Honestly, since both answers do not satisfy me, this is mine ..

Let's look at our code line through the line;

  DateTime Date = DateTime Pars ("16/05");  

uses your settings by default , if none IFormatProvider does not provide the second parameter as its overload This means that if you have any DD / MM from your current culture (or your current culture's means the current meaning then I would like to present the date of the current culture In separator ), this parsing operation will be successful. This means that this line throws probably FormatException which relies on existing culture settings.

  string nowadays date = date time.Now Toasting ("MM / dd");  

Datetime.now gives a local working time. With this, ToString () method you try to get it with a string representing the format MM / dd . but wait! You used the / format specifier again and still, you have not used any IFormatProvider . Since this format varies with the current culture date separator from the specifier, so your todaydate can be 05/16 , 05-16 or 05.16 . It relies entirely on the date separator that your current culture is used to.

  Convert. Tutorial (nowadays)  

Convert.ToDateTime method explicitly uses DateTime.Parse , because you have any Also, the IFormatProvider is not provided, it will use your current culture and this is the standard date and time format. As I said, the result may be nowadays can be 05/16 , 05-16 or 05.16 But it's no guarantee that your existing culture parses this string successfully because it can not be in in standard date and time formats MM / dd If it parses "16/05" successfully, it means there is a dd / MM format, in that case, of course can not be MM / dd as a standard date and time format. A culture no can parse DD / MM and MM / DD formats at the same time. In such a case, it does not know that the 01/02 string should be parsed as 2 January or 1 February, okay?

  Convert.ToDateTime (date1.ToString ("MM / DD"))  

Here is the same as todaydate It is a string, it will result in "05/16" result (this depends on the existing culture date separator) and still there is no guarantee of successfully parsing it. / P>

And as stated in the comments, there is no point in parsing your string in datetime, and it also gets the representation of the same string.

I strongly suspect that you try to compare your current date or not, compared to your parsed date time, you can use it to compare it with. This property gets as a datetime in the form of current date part plus midnight time. for example;

  dated DT; If (DateTime.TodayTypeExact ("16/05", "DD / MM", Culture Info. InvoiceTechTech, Datetime Style No, Out DT)) {if (Datetime.DateTime.DT) {// Your Operation}} < / Code> 

javascript - HTML5 Canvas Text not appearing? -


I know this is a frequently asked question, but I am very confused why my code is not working This is for my Bela where I have problems. The main problem is found on lines 85-87 where it is not displayed.

  ctx.fillStyle = "white"; Ctx.font = '80pt Helvetica'; Ctx.fillText ("Hello World!", 100, 100);  

Good, you're updating, then render

For example:

  function draw () {Ctx.fillStyle = "black"; Ctx.fillRect (0, 0, canvas.Wind, canvas.high); If (gamestate) {ctx.fillStyle = "white"; Ctx.fillRect (player.x, player.a, player.method, player.height); Ctx.fillRect (ball.x, ball.y, ball.width, ball.height); } If (gameState === false) {// For example, for example, click here ctx.fillStyle = "White"; Ctx.font = "bold 16px aerial"; Ctx.fillText ("PONG", 100, 100); } // gamestate} The end of the ceremony game () {update (); to present(); } // ... function render () {ctx.clearRect (0, 0, canvas.width, canvas.height); Attract (); }  

Pro-tip: Also consider step-debugging. It is often useful with such situations.


javascript - Meteor: how to open external links in Safari -


I am using meteorite 1.0.3.2 to create a hybrid app that includes links that use vendor websites Are there.

My dilemma: I can not contact Safari. All of my links are being loaded in WebView. I have tried some methods which recommend editing my appellगit with code, But I'm more interested in setting up an HTML and I do not have to do anything.

I'm looking deeply linking but there is not much that can be found on Safari. I've found that only working code, the search engine to paste the contents into the search bar href = "x -web-search: //? Using http: //website.com " I think if I can do this, then targeting me to a website with some variation of the website should be able. If someone knows something about this, please tell me!


Thanks!


Escaping from Equation Editor in VBA Word -


I am opening the equation editor program in MS Word using code

  ObjRange = Selection.Range set objRange = Selection.Math Add (objRange) Selection.TypeText text: = "a ^ 2 + b ^ 2 = c ^ 2" Selection.TypeText text: = "1/2" set objEq = objrange.omaths (1) objEq.Type = wdomathInline objEq .buildUp  

Now I want to exit the equation editor so that I can type some regular text. I could not find a direct route. I have an alternative solution, which means to enter it effectively and then going backspace once.

  Selection.Type Paragraph Selection. Mov Left Unit: = wdCharacter, Calculation: = 1  

But is not there a cleaner way?

Thank you.

OK, it's actually very simple Type:

  Selection. Above right unit: = wdCharacter, calculation: = 1  

is created after the equation.


Using JQuery -> QUnit in jsfiddle without external resources -


I was trying to test a quinn code snippet in jsfiddle, and see if you have frameworks and Under the extension, choose JQuery , a quinn note check box appears. I clicked it and required

  & lt; Div id = "qunit" & gt; & Lt; / Div & gt; & Lt; Div id = "qunit-fixture" & gt; & Lt; / Div & gt;  

then added

  // tried first: exam (work) (ok (true, "test");}) ; // Try again: QUnit.test (Task (emphasis) {OK (true, "test");});  

In the Javascript box, click Run and nothing happens, and Chrome's Dev tool's Javascript console shows that Quinn is not defined.

Googling shows several quick examples where they have included QUnit.css and QUnit.js as external resources, but I am thinking that JSFDL's quinnit external resource option has broken, or If I'm doing something wrong.

"post-text" itemprop = "text">

By comment @ j08691:

In the console I see the resource Failed to load: The server responded with a status of 404 (not found). It seems that the people of JSWલ્ડ people need to update their link.

By 3/16/2015, this is the case.


plot - R Time series scatterplot issue -


I have a problem with scatter plots in R. I am trying to plot the two time series but I always get a chart, the value of that year's value is the P-T value which I set. Each series has 120 values, this is the command:

  plot (x, y, pch = "+", col = heat.colors (120))  
< P>

you points

() function to plot more than one series. Think about your plot as a "canvas" and you are "painting" the extra layers with work.

<
  x  

python - Scipy ODE integration using dopri5 method -


I get an error when solving the coupled differential equation and I do not get it because I am new in Python.

"Dupree 5: Step size becomes very small messages (idid, 'unexpected idid =% s'% idid))

" Please tell me about the OD Antileter Help me with the proper explanation in

 gt: solver.integrate (current_t, step = 1) i + = 1 z = solver.y if i  

I do not know how to solve it, especially since skillful has no viable method ...

Also known as Dupri 5 or RK45 Is a run-cut method that mixes order-4 and order -5 method. Order -5 method is used as a proxy for exact value to estimate the error of order-5 method if the error is not relative to the phase-size and problem scale in the pre-defined range, then the step-size Is reduced or extended. This allows for integration to match some predefined global error to the least effort.

In the rigid system it may be that reduction in step-size is never successful in running an error in the acceptable area. There are probably some unsuccessful -rereases, so that this bad behavior can be found on an important part of the integration interval, invalidating all error estimates.

Using the built-in methods to solve the rigid system integration, as the notation methods

I did not find an indication

Is my bracketing the issue here? Or is there really an unexpected identifier? Javascript/jQuery -


I am creating a simple app that increases the count down to each picture on click I think it's compiling a problem or I'm missing some silly and obvious

& lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; Cat clicker & lt; / Title & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = 'app.js' & gt; & Lt; / Script & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; Cat clicker & lt; / H1> & Lt; Img class = "catpic_one" src = "cat.jpg" alt = "mountain view" style = "width: 304px; height: 228px" & gt; & Lt; P class = "counter_one" & gt; 0 & lt; / P & gt; & Lt; Img class = "catpic_two" src = "catpic2.jpg" alt = "mountain view" style = "width: 304px; height: 228px" & gt; & Lt; P class = "counter_two" & gt; 0 & lt; / P & gt; & Lt; / Body & gt; & Lt; / Html & gt;

js

  $ (document) .ready (function () {var click_on = 0; var click_tobu = 0; $ ('# catpic_one') ("Click", "#counter_one", function () {clicks_one ++ var clickcount_one = clicks_one.toString (); $ ('# counter_one'). Attachment ("You clicked the cat # 1" clickcount_one "times." ) $ ('#cuper_two'). ("Click", "#counter_two", function () {clicks_two ++ var clickcount_two = clicks_two.toString (); $ ('# counter_two'). Clicked # 1 "clickcount_two" bar.);}});  

catpic_one and Catpic_two class is not id, please call ' # 'To'. ', like

  make changes to' Catpic_one 'and' .catpic_two ' 

c# - Splitting audio into left and right channel into seperate files -


I'm having trouble separating channel buffers into a new file.

Here is the code to remove each channel buffer:

  int sample dzed = 10000; Byte [] buffer = new byte [sample skipped * 4]; Small [] left = new small [sampled dish]; Small [] right = new small [samples] dropped; (Using the WaveFileReader PCM = New WaveFileReader (filePath)) {int bytesRead = pcm. Read (buffer, 0, 10000); Int index = 0; For (Int i = 0; I  

And here's how I try to create a file from the collected buffers:

 using  (var leftChannelFile = new WaveFileWriter ("test.wav", new waveform ()) {leftChannelFile.WriteSamples (left, 0, left.length); }  

The problem is, when I try to run "file.wav", then it is 0 seconds long and 19.5 billion bigger. Why is this happening on any idea?

You either set the title of the resulting file so that it indicates that it is a channel / Mono,

or

You add a second empty channel to your result files (all 0 bytes)


javascript - using multiple style sheets -


I am currently developing an educational website and under it is to include web access as a feature. Have I seen something like trying to include a color material converter here? But I can not understand how to call many CSS external style sheets to the page so that the color of the content changes when the link is clicked? Any help is appreciated.

There are two ways to include your external CSS,

  1. & lt; Link & gt; Using the element, or
  2. Using the @import rule.

& lt; Link & gt; element:

To make it a continuous stylesheet:

  & lt; Link rel = "stylesheet" type = "text / css" href = "Somefile.css" media = "screen" & gt;  

To create a favorite stylesheet, add the title attribute:

  ` 

To create an optional stylesheet, add the word "alternate" to the rel option.

& lt; Link rel = "Optional stylesheet" type = "text / css" title = "compact" href = "somefile.css" media = "screen" & gt;

Using an @import rule:

It is possible to use @import using a stylesheet using another. It should be done at the top of any CSS before any rule is declared.

  example (in somefile.css): @Churset UTF-8 @import "someotherfile.css"  

This is also possible:

  & lt; Top & gt; & Lt; Style & gt; @import "somefile.css" & lt; / Style & gt; & Lt; / Head & gt;  

You must be sufficient to help understand how to include multiple external style sheets. Take care and good luck .... !!!


Writing parallel code using OPENMP -


निम्नलिखित कोड खंड पर विचार करें

  sum = 0; के लिए (i = 0; i & lt; n; i ++) योग = myfunc (a [i]) + योग;  

OPENMP का उपयोग करके समान समानांतर कोड खंड लिखें।

मैंने ऐसा किया,

  sum = 0; #pragma omp समानांतर के लिए (i = 0; i & lt; n; i ++) योग = myfunc (a [i]) + योग;  

मैं समानांतर कंप्यूटिंग में एक नवागंतुक हूं। क्या आपको लगता है कि यह सही है?

आपकी मदद के लिए बहुत-बहुत धन्यवाद!

इस राशि का विवाद विवाद का एक मुद्दा बन जाएगा क्योंकि प्रत्येक पुनरावृत्ति इसे छूती है चूंकि आप कम कर रहे हैं, आपको ओपनएमपी को पता है कि आप सभी थ्रेडों में जमा चर को चाहते हैं, इसे कम करने के लिए उपयोग करना चाहिए:

  sum = 0; #pragma omp समानांतर के लिए (+: योग) के लिए (i = 0; i & lt; n; i ++) योग = myfunc (a [i]) + sum;  

datetime - Finding a Specific Date with SQL -


I am trying to search in a database for a record with a specific date. I have tried to search in the following ways:

  SELECT * to TABLE_1 WHERE CAL_DATE = 01/01/2015  

and

< Pre> SELECT * TABLE_1 WHERE CAL_DATE = '01 / 01/2015 '

I am working with an Access database, and in the table, dates are showing in dates The same format (01/01/2015) Do I miss something in the SQL statement?

Any of the following options should work:

Direct date Format query in.

  SELECT * FROM TABLE_1 WHERE CAL_DATE = # 01/01/2015 #;  

The date value function will convert a string to a date.

  SELECT * FROM TABLE_1 WHERE CAL_DATE = DateValue ('01 / 01/2015 ');  

The CDAT function will convert a value to a date.

  SELECT * FROM TABLE_1 WHERE CAL_DATE = CDAT ('01 / 01/2015 ');  

The date serial function will return the date given by the year, month and day.

  SELECT * FROM TABLE_1 WHERE CAL_DATE = DateSerial (2015, 1, 1);  

See the following pages for more information on the above tasks:


php - How I can install and configure an existing Laravel Project? (Laravel 4) -


I need to install and configure an existing Laravel 4 project.

I tried to do this, but when I came across a number of issues with composer update or composer installs .

I also have a database (with data) so I ran the migration, but it does not work because the console shows me an issue about "The table is not present"

Can someone tell me the whole process of configuring the app?

I mean, its first, second and so and so because in some steps I made a mistake

  • To install and configure an existing project, you typically see

    1. its source code

    2. Install Composer

    3. Run php artisan migrate

    4. Third Check out README for specific instructions for setting up party assets Any extra steps required to take you

    If the above errors occur, due to some in your environment (old project is to be installed?). Or some problems like Laravel developer have created their own project.


  • android - SurfaceView and TextureView in the same application -


    I am developing an application using the Camera2 API with no preview. I have used textureview for the part of the camera, but now I need to use a SurfaceView to display dynamic image.

    I did some tests and I am getting this error: E / SurfaceTtextureClient (13629): Cubeber: Error

    Thank you already!


    lambda calculus - Access outer variable inside a block and Y-combinator -


    I hope all of you will be okay I will set fixed-point Y-connector in the harbor I'm implementing and I'm having some trouble with it. Well, the Y-connector can be defined as lambda-calculus :

    Y = (λh.λF.F (λ x. (( H (h))) (f)) (x)) (λh.λF.F (λ x. ((H) (f)) (x)))

    < P> I am trying to implement the memoanization with the Wi-connetator by display queries. I am currently implementing:

      Function Wiemam (BF, unchecked) Local xAnswer if! LCache; LCache: = {}; Andif return {| Arg | IIF (ACHES [ARG]; / * then * / ACHCH]; / * Otherwise * / ACHACH [ARG]: =; EWAL (EWAL (BWF, {NN. EWAL (EWAL (YMM, BF, ACHT) Actually, I can not use the statement in the blocks, but I can use the expression and it works just fine. . I am avoiding an infinite recurrence and the range is going from 0 to infinity.  

    By this time, it's just compiled properly, but when I'm trying to use a variable of an external block, harbor kicks me in the face!

    To check the implementation of the Wi-Connectator, I try to apply a general inequality of the Fibonacci sequence, but when I return a block that receives a parameter G And returns a block which returns a parameter N , live BKM is unavailable for me and the compiler says that "external codeblock variable is out of reach" .

    main functional bFib: = YMem ({| G | | | | | N | | IIF (n == 0, 1, IIF (n = 1 1, 1, Eval (g) N-1) + EVAL (G, N - 2)));}}})

    This will also allow me to make blocks. My question is how can an external variable be used inside a block in the harbor

    In Harbor, Clipper and XBase-based programming languages ​​can refer to variables of the block, never blocks. Blocks are not closed We can make those local stones and use them in internal blocks:

      Function TestOper Scope Local AAAA Local Bad: = {| A. ACCA: = A, {| B ACCA + B}} Eval (bAdd, 10), 20)  

    TypeError: matrix[y].push is not a function when trying to create 2d array with javascript -


    I am trying to create an array that represents a matrix (256 × 256), is full of zero Which I will change later with the works I tried to use for loops and .push function, but something is wrong and I do not know what is happening. Here is my code

      var matrix = []; For (x = 0; x  

    I have to do this, push an empty array in the matrix, fill it with 256 zeros, and then repeat 255 more times after that.

    The problem is that you are pushing only one array, 255 of them are trying to fill Are there. Your code should look like this (assuming you want to give 256 instead of 255)

    < Div class = "snippet-code">
      var matrix = []; For (var x = 0; x & lt; 256; x ++) {matrix peash ([]); For (var y = 0; y & lt; 256; y ++) {matrix [x]. Push (0); }}  


    css - Set iframe height in pixels -


    I want to display a top bar with a height of 72px height of my page and then load an iframe below Which fills the full page (topbar height height).

    Before I can start taking my top-bar too ... Somehow my IFrame sets any height attribute for it:

      Width = '100%' height = '1200' style = 'overflow: hidden; Height: 100%; Width: 100% 'or width =' 100% 'height =' 100% 'style =' overflow: hidden; Height: 100%, Width: 100% ' 

    I am reading this post:

    But do not have any luck here:

    height: 100% style , which is already deleted, now iframe Height should be 1200px.


    html5 - 2 Audio Elements with different SRC plays same file -


    I am using SHOUTcast to broadcast many radio streams. For some reason when two audio elements one page , They both play the same source despite being different.

    Please check the screenshot:

    ===

    > I do not understand this.

    What was not really the difference, but I was able to get it

     
    & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt; Audio control id = "1" & gt; & Lt; Source src = "http://live.soundcheck.xyz:8000/scur" type = "audio / mp3" & gt; Your browser does not support the audio element. & Lt; / Audio & gt; & Lt; Audio control id = "2" & gt; & Lt; Source src = "http://live.soundcheck.xyz:8000/r&b" type = "audio / mp3" & gt; Your browser does not support the audio element. & Lt; / Audio & gt; & Lt; / Body & gt; & Lt; / Html & gt;


    Not able to read data from Perforce using python script -


    Please help me read data / files from Perforce.
    I tried to read the file using the following code: Forcing to use this Python script

    The same code works fine in Python Shell , Even when this step works perfectly then it works perfectly.

    local file: Getp4file (outfile, errfile, path): path = 'p4 print' + open (outfile, "wb") , "Wb") as err: subprocess.open (path, stdout = out, Stderr = err) out.close () err.close () return getp4file ('config.txt', 'err.txt', ' Path_of_the_file ')

    5 seconds delay before return statement


    android - ORMLite : Out of memory Issue (loading over 30.000) -


    I would like to get some help with my problem

  • A sensor via Bluetooth (Zephyr Bioharnes ).
  • Obtain values ​​and save (250 price / sec) for 2 minutes (demo purposes)
  • Store values ​​on the database with ORMLite.
  • Read all of them to create JSON ( queryForAll () ).
  • Application Crash.
  • In the future, it can save prices for 30 minutes, so this is a problem that we have to solve in an efficient manner.

    My only thoughts are reading the values ​​by blocks, can I do this with ORMLite?

    If you have a better solution, it will also be appreciated.

    Thanks in advance.


    c# - how to convert datetime format -


    Hello I was giving a text box to the user and Ajax calendar amplifier to select the date in the format dd / mm / yyyy After that I have to use the following function to convert it to the / mm / dd / yyyy format to be inserted in the SQL Server database, but it does not work well in one page, error date time conversion error Mile and other To enter the data, I need to enter yyyy / mm / dd format. My code works fine in the local host in the database, but the errors are coming in the server. I have my work

      protected String (string indicates) {System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo ("en-GB"); Datetime DT Project StartDate = Convert. Date time (inDate); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo ("en-US"); Return (convert .titime (DT project startup). Ostring ("MM / dd / yyyy")); }  

    To add more I used it like getDate_MDY (txtcreatedate.text);

    I just yyyy format from the DD / MM / Text box to the correct date in the database. Please show me the correct way to modify it ... Thanks

    Use DateTime.Parse Instead of changing the current thread culture, code> or date time.parsect

    for example:

      protected string getDate_MDY (string Indiatimes) {DateTime date = DateTime. Pars (indet, new culture info ("n-GB"); Date of return Toastring ("MM / dd / yyyy", New Culture Info ("N-US")); }  

    This is not the most effective way of doing this (you probably want to cache CultureInfo cache for the beginning), but what will it be for you? / P>

    However, as someone has mentioned in the comment, you should not tell the date of wire (i.e. convert from one culture to another).

    Instead of for a SQL command, they should be defined as the date / time parameters in the SQL command:

      (var connection = new SqlConnection (" 

    java - How to draw a circle with Bitmap pixels? -


    In my app I mix 2 bitmaps, a bitmap is on the screen and when I swipe with my finger The matching pixels from other bitmaps the way I have worked now, but when I touch the screen, it only reveals intersections with other bitmaps because pixels are square, and I touch the screen and expose them to a group I am here. How do I group the pixels together to create a circle?

    This is my current code:

      @ Override Public Boolean on Touch Event (Motion Event Event) {Super. Totevent (event); If returned (! Surface Prepared); // Check if the touch pointer is the one you want (event.getPointerId (event.getActionIndex ()) == 0} {switch (event.getAction ()) {Case MotionEvent.ACTION_DOWN: // user touched the screen. Case MotionEvent.ACTION_MOVE: // The user pulled his finger ... mix ((int) event.getX (), (int) event.getY ()); } // Here the blending effect update the bitmap and trigger a frame // radra, // if you do not have the animation thread for doing so drawOverlays (); Back true; }      return false; }  

    More compositing code:

      // I made a big brush public to make the effect more "visible" BS = 50; Public Ent HBS = BS & gt; & Gt; 1; Int [] Pixels = New Int [BS * BS]; Private Zero Blend (int x, int y) {if (x> = HBS & y> = HBS & amp; amp; amp; x  


    javascript - HLS to MPEG DASH -


    IM is currently working on a platform that depends on MPEG dash so that the audio and video are delivered to the browser Could. OnMemand im using ffmpeg to encode video for h264 / aac and mp4box to create manifest.mpd file. Now to know how to create a GM MPEG dash stream, IM provides live streams for Mpeg Dash, more specifically HLL.

    1. Do I have a .ts segment? MP4 (H.264 / AAC) segment, since Chrome does not support MPEG2S?
    2. If so, how do I re-encode all segments (separate resolutions, different bitrates) incessantly?
    3. How do I see a dynamic manifest MP4Box / input parameter

    If you represent / represent the presentations of HLS stream, you basically need to reapply the MPEGTS segment in the MPPFT / MP4 segment. Create Dash Ins files, streaming server like WoZo or Unified Streaming that can be phayek


    c# - Whats the best way to search files in a directory for multiple extensions and get the last write time according to filename -


    I found a hard time with the linux in the follow up. Actually I have to find a directory with a DBN, do not know Whether the file will be .bak or .7z If there are many files in the same file, I would have to meet with extention .7z. If there are several files with the same DBNN and extension .7z then I have to get the file at the last writing. This is what I have so far.

    string [] files = directory. Gatefiles (directory, "*. *", Searchoption.tap directory); Foreach (file name in file) {var dbName = "test"; Var extention7 = ".7z"; Var extentionBak = ".bak"; If (fileName.Contains (dbName) & amp; amp; amp; (fileName.Contains (extention7)) fileName.Contains (extentionBak))) {Console.WriteLine (fileName); }}

    I will not make a LINQ solution only for this - it will be understood It is very difficult.

    Here's what I will do:

      string gatedesk file (string folder, string dbnname) {var files = directory.expected files (folder, dbName + "*. *"). Select (x = & gt; new {path = x, extension = path.gate extension (x)}). Where (x = & gt; ex extension == ".7z" || x.extension == ".bak") .oir (); If (files.Length == 0) return tap; If (files.Length == 1) returns the file [0]. Path; Var zippedFiles = files.Where (x => x.Extension == ".7z"). ToArray (); If (zippedFiles.Length == 1) zipfile file [0] will return. Path; Return zippedFiles.OrderByDescending (x = & gt; File.GetLastWriteTime (x.Path)). first (). Path; }  

    Please note that this does not take into account the case where there is no .7z file, but if multiple .bak files for DB can be this scenario, then you According to this the law must be expanded.


    html - What happens if html5 elements are included in browsers that do not support HTML5? -


    What if the audio tag is included in the lower version of html5?

    Thanks in advance

    Nothing happens, and the audio is not displayed . For example, using the IE7 emulator, try it in the Developer Tools in Internet Explorer.


    jquery scroll to function except special link -


    यहां कोड है और

      $ ('a [href =' # ' ] () "पर क्लिक करें", फ़ंक्शन () {var लक्ष्य = $ ($ (यह) .attr ("href")); यदि (target.length) {$ ("html, body")। {ScrollTop: target.offset ()। शीर्ष}, 500);}});  

    काम करने के लिए एक साधारण स्क्रॉल, कुछ समय जब # पर क्लिक करें पूरी तरह से ऊपर स्क्रॉल नहीं होगा, शायद अन्य फ़ंक्शन ने शीर्ष अनुभाग में देरी की, मैं $ ("html, body" ) .मेट ({scrollTop: 0}, "500"); यह काम सही है, और मेरे पास दो सवाल हैं

    1. अगर मुझे इस पर # फ़ंक्शन, मैं कैसे # पर क्लिक करें #top

    2. की जांच कर सकते हैं और फिर यह $ ("html, body") करें। चेतन ({scrollTop: 0}, "500"); , नहीं scrollTop: target.offset ()। समारोह का शीर्ष , ऐसा करने का कोई आसान तरीका?

    बहुत बहुत धन्यवाद

    जांचें कि href समान नहीं है '# शीर्ष'। आप इस तरह से कुछ कर सकते हैं

      $ ('a ^ [^] = "#"]। पर ("क्लिक करें", फ़ंक्शन () {var target = $ ($ (this) .attr ("href")); यदि (target.length & amp; $ (this) .attr ("href")! = '#top') {$ ("html, body")। चेतन ({scrollTop : Target.offset ()। शीर्ष}, 500);} और {$ ("html, body")। चेतन ({scrollTop: 0}, 500);}});  

    यहां एक

    है

    How Does Mercurial Communicate Changes Between Clients? -


    I'm sorry if this question looks ridiculous, but I think it's a straightforward answer anywhere Can not find. .

    I'm considering using Mercurial for source control over a small (2-3 developers) project, I do not know about subscribing to a central repository, and I like all that Has a complete copy of this project. What I do not understand is how the mercury clients make changes in each other. Does a particular port need to be opened or something similar?

    Any indicators, which help for the commentary from Mercurial or those who have used it, will be received with gratitude.

    Mercurial can reach remote repositories in many ways. The main types are:

    • Use the file (i.e. see the repo on this path)
    • HTTP / HTTPS (i.e. look at the repo at this web address)

    The first really works only if your team has all the shared file system, But it is also useful if you have many clones that want to transfer information between you.

    HTTP is how you can access a bitbasket or some other "Available to all" server You can set up a temporary server on a machine with the command hg service And this is useful if you have to share quickly with a colleague and do not care about security, but usually HTTP Merchant Server sits behind Apache or some other web server software.

    An SSH based set-up is a machine running only one SSH server, which has Mercurial installed. Logs on the disorderly machine, and invokes hg from a distance. Then talk to the local hg and the remote hg link. In my opinion it is very easy to set up Certification All are handled in the normal SSH manner.

    Read further:


    php - Wordpress Cron Error "SSL certificate: unable to get local issuer certificate" -


    I encountered an error on my WordPress installation with not being able to execute wp-cron.php from Wordpress I am here. Debugging tool "Control" error reports "SSL certificate: Unable to get local issuer certificate".

    WGET is not able to reach wp-cron.php, which is most likely due to the SSL problem. I need wp-cron to run newsletter tools and more.

    It is very strange that the same error occurs on other WP installations on the same server, which does not even have an SSL certificate or even use HTTPS. The error remains the same.

    I have already tried to solve the problem with other Wordpress plugins, but there is no luck. Since the message is independent of the same site or I think the problem lies somewhere other than Wordpress.

    Any ideas are appreciated appreciatively!

    Which version of WordPress are you running? If this version of version 3.7 can be added to the end of your wp-config.php at the end of the line:

      add_filter ('https_ssl_verify', '__return_false'); Add_filter ('https_local_ssl_verify', '__return_false');  

    I created a short guide here:


    c# - How do I provide an implementation of ProjectItem.get_FileNames(i)? -


    I'm trying to set up a good REPL to run csharp code. However, I do not seem to implement the code for the implementation of the ENV.Program Item (interface).

    Definition of property misbehaving on the interface is in the indexer:

    string filename [abbreviate i] {get}}

    Based on I tried

      [index name ("filename")] string project itam [this small]  In this clear interface announcement 'this' is not a member of the interface  Public string {[i.ic. i] {back {return "test";}}  [indexerName ("FileNames")]  

    Accessor 'UserQuery.ProjectItemFake.this give Ta [Short] .get 'Interface Member' can not apply to 'EnvDTE.ProjectItem.get_FileNames (short)' type 'UserQuery.ProjectItemFake'. Use a clear interface implementation.

      [index name ("filename")] string project itam. [In summary] {{return "test";}}  

    returns In the clear interface announcement 'this' is not a member of the interface

    I'm completely open to pure languages ​​with primary understanding C #, F #, or VBnet.

    Can you type an implementation of the interface EnvDTE.ProjectItem in? Net?

    Just apply the method get_FileNames (short i) .

    Attributes (including indexed ones) are actually converted into methods under get_PropertyName and set_PropertyName hood. In most cases, the compiler does not allow you to apply such properties, but only because this member relies on metadata. Named index is not available in C #, but they are available in VB.NET, and I think the transfer was defined in VB.NET (they are, but I'm not sure they are compatible).

    The C # compiler lets you apply VB.NET indexed properties as get_PropertyName (whichever X) because the only way to implement them is to try it And it works for me.

    A complete C # implementation is as follows:

      class ProjectItemMock: ProjectItem {public bool SaveAs (string newFilename) {return false; } Public EnvDTE.Window Open {Name of String} {return null;} Public Zero Extract () {} Public Zero ExpandView () {} Public Zero Save (String Filename) {} Public Zero Removal () {} public bool IsDirty { Get; Set;} public string get_FileNames (short index) {return "test";} public short file count {get; Set;} public string name {get; Set;} public string type {get; Set; } Public EnvDTE.ProjectItems Archive {get; Set;} Public EnvDTE.Properties Properties {get; Set;} Received public EnvDTE.DTE DTE { Set;} public EnvDTE.ProjectItemsProjectItems {get; Set; } Public Bull get_IsOpen (strings) {return false;} public object object {get; Set; } Public object get_Extender (strings) {return tap;} public object ExtenderNames {get; Set; } Public string ExtenderCATID {get; Set; } Public bullet saved {get; Set; } Public EnvDTE.configurationManager ConfigurationManager {get; Set; } Public EnvDTE.FileCodeModel FileCodeModel {get; Set; } Public EnvDTE.Document Document {get; Set; } Public EnvDTE.Project SubProject {get; Set; } Public EnvDTE.Project ContainingProject {get; Set; }}  

    php - htmlentities and html_entity_decode do not behave as reverse -


    I want to shorten a string in a certain amount of characters. This string contains the HTML characters. Notice that I stripped all the html-tags from the string. Now, if there is a special character in the breakpoint, then it should not be broken in the middle of the HT character, but these examples do not work after this, or after:

      // Example 1 $ str = "French france for French and CCLL; AIS"; $ Str = substr ($ str, 0, 27); // $ str in "French French is & amp; c;" // Example 2 $ str = "N Dash & amp; # 8211;"; $ Str = substr ($ str, 0, 25); // $ str include "N dash looks & amp; ##;;  

    So I thought that I should convert special characters into one letter, make transcription and then return a single character to special characters. It works in the first instance, but the second is not.

      // Example 1 $ str = "French is French and Frank franc for; ais"; $ Str = html_entity_decode ($ str); $ Str = substr ($ str, 0, 27); $ Str = htmlentities ($ str); // $ str is "French French franca"; // Example 2 $ str = "N Dash & amp; # 8211;"; $ Str = html_entity_decode ($ str); $ Str = substr ($ str, 0, 25); $ Str = htmlentities ($ str); // $ str include "N dash looks & amp; ##;;  

    For both examples what should I do, the way I expect them, what should I do?

    Homelandat will default your default_charset php.ini value for your encoding uses it. If you are not using characters that support characters that you are changing, then it can not behave as expected. Try it and see if you get different results.

    htmlentities ($ str, null, 'utf-8');

    html_entity_decode $ Str, null, 'utf-8');

    mb_substr ($ str, 0, 25, 'utf-8');


    gis - how to save geojson(in javascript) to geometry(MultiPolygon,4326) in PostGIS with Hibernate -


    I am working on JSF Project (version 2.2) I have a geographic object in javascript. On the other hand, I am using Hibernate 4.3.8 and PostGrussCl 9.3, a column of type of Grametry (multiplex, 4326) in postgis on the other side.

    Geometric column definition in model class

      @ type ("type =" org.hibernate.spatial.GeometryType ") @column (name =" geome ") private polygon Land;  

    I have also included Hibernate Spectile 4.x in my project and I can access the GeoZone string in Managed Bean. But I do not know how I can do this in my database. I might have to parse geogeogen and by geographical coordinates I will not have succeeded, but what is the way to do that?

    Thank you in advance.

    c# - Programmatically copy in-use files -


    In my C # code I want to be able to use some shadow copy so that the files used by others The process can be copied.

    I have seen that the solutions are present on the web, in the enterprise or command line tool. But can it be programmed to copy a simple file copy?

    It appears that what you want to do. The sample file VssBackup.cs is exactly what you want to do.

    This class charges some simple VSS logic. Its goal is to allow a user to back up a file with a shadow copy (presumably because that file is otherwise unavailable on the volume of his home)


    nlp - What is the most efficient way to convert spoken language dates to a normalized form? -


    In spoken language processing, a standard computer can understand that changing the different ways of expressing the date What is the best way? For example we can say that tomorrow: tomorrow, after day, two days later, at the end of next week, during this week, etc.

    I have searched through the internet and have found that I do it with writing rules and patterns Can i Olympus System is a complete communication system that provides good ways to do this through its datetime binding filter.


    php - Add condition to join table in pagination query (CakePHP 2.0.4) -


    All images are default category images and other category related image descriptions are created in that table. This list will display the following questions in 2 categories (Pagesgun) of categories.

    Select `Class`````````````````````````````````````````````````````````````````````` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` ` `` `` , `` `` ``` `` `` `` `` `` `` `` `` `'`' `` `` `` ` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` ` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` 'Improved', `Image`. `` Image`` in the form of `image` from` images`, where `image`. ' Category_ID `IN (60, 17, 9, 33, 71, 18, 73, 30, 58, 54, 3, 44, 64, 66, 67, 11, 53, 16, 23, 68) Pre>

    But in fact, the second should be like the query:

      choose `image```````````````````````````` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` ` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `Image``` Image` as `Image` in category_ID (60, 17, 9, 33, 71, 18, 73, 30, 58, 54, 3, 44, 64, 66, 67, 11, 53, 16, 23, 6, 8)  

    may be

    image . In the default = 1 WHERE section.

    My Controller is FPP Index Action:

      Public Function Index () {$ this- & gt; Category-> Recursive = 1; $ This- & gt; Category & gt; Behaviors-> Gave ('keep'); $ This-> gtaginate = array ("contain" => array ("image")); $ Search = ""; If (isset ($ this-> params ['name'] ['search'])) {$ search = str_replace ("% 20", "", $ this-> parameter ['name'] ['search'] ); $ Circumstances = array ('OR' = & gt; array (array ('named as category' = '>'% '. $' Search '%))); $ This- & gt; Set ('categories', $ this- & gt; paginated ($ terms)); } And {$ this- & gt; Set ('categories', $ this- & gt; paginated ()); } $ Success = $ this- & gt; Session-> Read ('success'); $ This- & gt; Set (compact ('search', 'success')); }  

    and in the category of my category:

      many = array in public $ ('panel' = & gt; array (...) , 'Image' = & gt; array ('className' = & gt; 'image', 'foreign key' = & gt; 'category_id', 'dependent' = & gt; false, 'conditions' = & gt; array ('Image.default' = & gt; '1'), 'Field' = & gt; '', 'order' => "',' limit '= & gt;", "' offset '= & Gt; '', 'Exclusive' =>, '', 'Finder' =>; '', 'countertype' =>););  

    Therefore, I have to filter the joining table images. Set the default set to '1'

    Change this row in your categories controller:

      $ this-> paginate = array ("contain" => array ("image")); From  

    to:

      $ this-> paginate = array ("contain" => array ("Image.default = 1"));  

    More info here:


    java - I am getting following warning in my netbeans project -


    I am trying to make connections to mysql program. I'm getting this kind of warning

      Run: 16 March 2015 7:11:49 PM Read java.util.jar.Attributes WARNING: MANIFEST Duplicate name in: Class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. March 16, 2015 7:11:49 PM Read java.util.jar.Attributes. Warning: duplicate in duplication name: class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. March 16, 2015 7:11:49 PM Read java.util.jar.Attributes. Warning: duplicate in duplication name: class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. March 16, 2015 7:11:49 PM Read java.util.jar.Attributes. Warning: duplicate in duplication name: class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. March 16, 2015 7:11:49 PM Read java.util.jar.Attributes. Warning: duplicate in duplication name: class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. March 16, 2015 7:11:49 PM Read java.util.jar.Attributes. Warning: duplicate in duplication name: class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. March 16, 2015 7:11:49 PM Read java.util.jar.Attributes. Warning: duplicate in duplication name: class-path. Make sure there are no duplicate entries in the manifest, and these blank lines separate different sections in both your manifest and meta-INF / MANIFEST.MF in the Jar file. Username exists, successfully developed (total time: 0 seconds)  

    I have tried to convert mysqlconnector correctly too.

      manifest-version: 1.0  

    is my manifest file.


    Access order_by foreign model field in Django ResultSet -


    सोचिए कि आप कुछ ऐसा कर रहे हैं

      books = book.objects.all ( ) .order_by ('shopsales__qty')  

    जहां दुकानों की बिक्री ShopSales मॉडल का एक संदर्भ है, जो किसी विशेष पुस्तक की बिक्री को स्टोर करता है एक निश्चित दुकान है और इसमें विदेशी की क्षेत्र को पुस्तक मॉडल और एक qty फ़ील्ड में वापस किया जाता है।

    अब उपरोक्त एक अलग तालिका से किसी फ़ील्ड द्वारा आदेशित अपनी पुस्तकें तालिका से सभी पुस्तकों को प्राप्त करेगा ऐसा करने के लिए, जेनरेट किए गए एसक्यूएल में शामिल हो जाएगा और पुस्तक मॉडल से सभी क्षेत्रों के साथ SELECT फ़ील्ड सूची में एक shopsales__qty क्षेत्र जोड़ देगा। हालांकि, यदि आप अपनी लौटे किताबों के माध्यम से जाते हैं, तो ऐसा प्रतीत होता है कि ऑर्डर करने के लिए इस्तेमाल किए जाने वाले विदेशी फ़ील्ड को हटा दिया गया है। (भले ही यह ऑर्डर देने के लिए चुना गया है।)

    उस फ़ील्ड को वापस लौटा पुस्तक ऑब्जेक्ट्स में रखा गया है?

    आप उपयोग कर सकते हैं

      books = book.objects.all ()। Order_by ('publisher__revenue')। Value ('title', 'publisher__revenue')  

    यदि आपको अधिक विशेषताओं की आवश्यकता है, तो आप उन्हें मान ()

    में जोड़ सकते हैं

    ios - How to show first 50 name from an array? -


    My array has more than 100 names and I just want to show the first 50 arrays.

    I have read this topic () but is there a better solution instead of adding two arrays?

    I am adding array like this

      - (zero) test {_myArray = [[NSMUTABELARROL] INIT]; [_myArray addObject: usersName]; }  

    If you want to keep it in a straight line, how many arrays within the table Can be seen, where the array table is the datasource of the view, you can just use the MIN macro with table disconnection data source - tableView: numberOfRowsInSection: method:

    Need to use
      - (NSInteger) Table view: (UITableView *) table view numberofferaase Insaction: (NSInteger) section {return MIN ([_ array number], 50); }  

    c# - Instead of currency symbol I get a question mark into the Command Prompt -


    I use Windows 7, Visual Studio 2013, C # and .NET 4.5.

    My problem is the output of the line given below:

      console. WrightLine ("Car's value: {0: C}", myNewCar.determineMarketValue ());  

    myNewCar.determineMarketValue () returns a double.

    How can I fix this problem?

    My output is: qmarkc #

      Using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; System usage threading. Task; Namespace Lesson 15 Simple Classes {Class Program {Static Wide Men (String [] AGR) {Car MyNew Car = New Car; MyNewCar.Make = "OldSmobile"; MyNewCar.Model = "Cutlus Supreme"; MyNewCar.Year = 1986; MyNewCar.Color = "Silver"; Console Output Encoding = SystemText.Nencoding.unicode; Console.light line ("{0} - {1} - {2}", My Newker.Make, MyEncar.model, Minwkar.console.lightline ("Car's value: {0: c}", myNewCar.determineMarketValue ( ); Console.ReadLine ();}} class car {make public string {get};} public string model {get; set;} public int year {receive; set;} public string color {get; set;} Determine Public Double Market Price () {Double Car Value = 100.0; if (this.Year> 1990) Car Value = 10000.0; Second Car Value = 2000.0; (Car Value);}}}  

    I added my code ... and have simple yet work: (

    Update: code to Console.optput encoding = SystemText is updated to use .Encoding.Unicode; and my currency and console settings are also shown below:

    You can see that the problem is that even though I use my code to use Unicode Dated, whenever I execute the program from VS, my CMD settings are changed to use the Lucid console font. / P>

    Last Editing: How fast and simple to use console fonts used by the Visual Studio Console Now the currency in my program looks correct:

    It is according to the design.

    The .NET Console application uses some predefined system fonts (usually text using the Leucida console, but it can be a console or another similar font).

    This font is not required for your currency, so S Ymbol can be displayed incorrectly. Look for the symbols of the currencies supported in the Lucida Console.

    You can not fix it easily in the console because changing the font used to display the text in the console is not so easy (this is possible with some WinAPI calls, I think) .


    node.js - Install Node Canvas With NPM Not Working -


    I am trying to install node-canvas with LAMP on CentOs 6. I have already installed and updated node js in the latest, as well as NMP.

    When I run the command: npm install canvas I just get the following errors:

      [root @ localhost tmp] # sudo npm install canvas & gt; Canvas@1.2.1 installed / tmp / node_modules / canvas & gt; The node-GIP reconstruction package was not found in the pangocairo pkg-config search path. You should probably add the directory containing `pangocairo.pc 'to the PKG_CONFIG_PATH environment variable. No package 'Pongokaio' was found: Status returned to 'pkg-config pangocairo --libs' 1. Binding to call. GP Jeep ERR! Configure Error Gipple ERR! Stack error: failed with `gyp` exit code: 1 gip err! Stack on hair process. Copax (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16) gyp ERR! Stack on childProcess.emit (events.js: 98: 17) gyp ERR! On Stack Process. Child Process._hand.onexit (child_process.js: 820: 12) gyp ERR! System Linux 2.6.32-504.8.1.el6.x86_64 GIP ERR! Command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuilding" GIP ERR! Cwd / tmp / node_modules / canvas gyp ERR! Node-v v0.10.36 gip err! Node-Jeep-V v1.0.2 GEP ERR! Not right NPM ERR! Linux 2.6.32-504.8.1.el6.x86_64 NMP ERR! Argv "node" "/ usr / bin / npm" "install" "canvas" NPM ERR! Node v0.10.36 NMP ERR! NPM v2.7.1 NMP ERR! Code ELIFECYCLE NPM ERR! Canvas @ .11.1 Installed: 'Node-GIP Reconstruction' NPM ERR! Exit status 1 NMR ERR! NPM ERR! Canvas@1.2.1 Install script failed 'Node-Jeep Rebuild' failed NPM ERR! This canvas package is most likely in NPM ERR! NPM ERR with NPM itself! Tell the author that it fails on your system: NPM ERR! Node-jeep NPM ERR rebuild! You can get your information: NPM ERR! NMP owner LS canvas NPM ERR! Upward additional logging output is likely to occur. NPM ERR! Please include the following file with any support request: NPM ERR! /tmp/npm-debug.log  

    You need to install Cairo and some other You can set the node canvas before the libraries.

    Just use the following commands:

    yum install -y cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel


    java - Dumping urban airship and getting unexpected response -


    I am using urban airship for my push notification. But many times in my server log, I get the error "java.lang.RuntimeException: unexpcted response" status code: 401 responseBody - authorization is required. (In the image) is there a bug with urban airship? Please any person can guide me properly.

    This error message is in the server log

    P>

    Authorization: Original

    In addition to this, their full response code list is here:

    401 Unauthorized: authentication information (app and secret) or So wrong Or was missing


    ember.js - How to get routeparameter of subroute in Ember -



    ember.js - How to get routeparameter of subroute in Ember -

    i want list appointments of persons ember app. have route defined like:

    this.resource('person', { path: "person/:personid/" }, function () { this.route('appointments', { path: "appointments/:date" }); });

    now have 2 templates

    person - template: show person's name @ top, {{outlet}}

    appointments - template: has backward, date , forwards button navigate through dates , appointments listed

    the controller of appointments handles navigation through dates

    controller.transitiontoroute("person.appointments",mydatevar)

    this rerenders buttons, because in same route. , don't that.

    i tried different approaches when separate navigation appointment list, need deal date in 2 controllers, or routes, somehow.

    the navigation needs know state of "subroute"-parameter of appointments-route. , think totally wrong.

    i confused :-(

    can help me out?

    there 2 ways.

    1. needs: http://emberjs.com/guides/controllers/dependencies-between-controllers/ 2. send: http://emberjs.com/api/classes/ember.route.html#method_send

    you can set date on appointments controller , utilize needs in order share info person controller. doing can have alias appointment date on person controller.

    app.personcontroller = em.objectcontroller.extend({ needs: 'appointments', date: ember.computed.alias('controllers.appointments.date') // whatever date property });

    you can send action parent route informing date has changed.

    app.personroute = em.route.extend({ actions: { datechanged: function(newdate){ this.controller.set('date', newdate); } } }); app.appointmentsroute = em.route.extend({ model: function(params){ this.send('datechanged', params.date); ... } });

    ember.js routing

    sql - Need to count two separate values in one column -



    sql - Need to count two separate values in one column -

    i'm trying sums of 2 separate values appear in 1 row, per unique id. i've tried couple routes still can't appear in 1 row. i've tried few different ways of using case statements , i've tried using on partitions, well, no avail.

    here query far:

    select distinct id_num, sum(case when isnull(sch.subterm_cde,0) '%n' 1 else 0 end) 'total_n', sum(case when isnull(sch.subterm_cde,0) '%t' 1 else 0 end) 'total_t' student_crs_hist sch sch.end_dte > getdate() grouping sch.id_num, sch.subterm_cde order id_num

    you right, grouping column:

    select id_num, sum(case when sch.subterm_cde '%n' 1 else 0 end) total_n, sum(case when sch.subterm_cde '%t' 1 else 0 end) total_t student_crs_hist sch sch.end_dte > getdate() grouping sch.id_num -- shouldn't grouping subterm_cde order id_num

    sql sql-server count

    c# - How to make a Cross-thread Operation using a form textBox thread-safe? -



    c# - How to make a Cross-thread Operation using a form textBox thread-safe? -

    in c# (visual-studio-express 2013), next code creates error described below:

    public void addtoapplog(string formatter, string loggerid, string logtext) { lock(this) { datetime datetime = datetime.now; string logentry = datetime.hour.tostring("00") + ":" + datetime.minute.tostring("00") + ":" + datetime.second.tostring("00") + "." + datetime.millisecond.tostring("000") + " [" + loggerid.padright(18, '·') + "]" + "> " + formatter + logtext + "\n"; applicationlog.appendtext(logentry); } // end of lock } // end of fellow member function: addtoapplog

    error:

    cross-thread operation not valid: command 'applicationlog' accessed thread other thread created on.

    what need ?

    use control.invoke:

    applicationlog.invoke((methodinvoker)delegate() { applicationlog.appendtext(logentry); });

    c# multithreading forms

    sql - write new values to variable but keeping the old value -



    sql - write new values to variable but keeping the old value -

    example:

    declare @string varchar(100) set @string = 'test string' -- add together string set @string = 'test string 2' select @string --return 'test string''test string 2'

    how this?

    you can append string this.

    declare @string varchar(100) set @string = 'test string ' -- add together string --tsql 2005 set @string = @string + 'test string 2' --tsql 2008+ --set @string += 'test string 2' select @string

    sql sql-server tsql

    php - How to return a datetime that can be converted based on different locales? -



    php - How to return a datetime that can be converted based on different locales? -

    we developing api in php, mysql 1 of fields returns datetime in format of yyyy-mm-dd hh:mm:ss. api in near future can used in different continents. in iso format should save datetime time offset can preserved too?

    does time job? or should utilize iso 8601?

    i've read in php can homecoming date/time with:

    gmdate('y-m-dth:i:sz');

    what suggest? in format should homecoming date/time?

    when deal dates can come various time zones, should store timestamp in mysql. in case, becomes irrelevant info comes (which continent). true saving data. now, when comes displaying date info people on different continents, have know time zone. using php's datetime, can utilize timestamp database, pair datetimezone , show right time time zone.

    also, when need exchange info between various services - providing timestamp allows target application apply range of time zones own formatting purposes. however, date storage should without time zone reliance. that's why timestamp plays huge utility role here - it's utc.

    now, let's provide code doesn't become all-talk.

    mysql's timestamp data-type stores value integer internally, displays datetime.

    $mysql_datetime = '2014-10-15 12:58:55'; // got database $dt = datetime::createfromformat('y-m-d h:i:s', $mysql_datetime); // have object can manipulate dates // let's assume have in new york wants see date formatted according time zone $dt->settimezone(new datetimezone('america/new_york')); echo $dt->format('y.m.d, h:i:s'); // format accepted same `date()` function.

    php timezone locale

    vb.net - Exclude Area within a Graphics Path -



    vb.net - Exclude Area within a Graphics Path -

    i working gdi , trying draw object top view. want draw round footstool feet when top see feet outside of main circle.

    i see plenty of examples of clipping outside want clip every thing within circle , paint circle outline.

    here sample code demo i'm trying do. easy , i've tried including region.exclude cant work.

    dim bmp new bitmap(500, 500) dim g graphics = graphics.fromimage(bmp) g.clear(color.transparent) g.smoothingmode = smoothingmode.highquality g.pixeloffsetmode = pixeloffsetmode.default ' add together 4 feet dim npoints point() = {new point(50, 5), new point(95, 50), new point(50, 95), new point(5, 50), _ new point(5, 5), new point(90, 90), new point(0, 0), new point(100, 100)} dim gp new graphicspath dim p pen = new pen(color.darkgray, 1) dim feetsize size = new size(10, 10) integer = 0 3 gp.addellipse(new rectangle(new point(npoints(i).x - (feetsize.width / 2), npoints(i).y - (feetsize.height / 2)), feetsize)) next g.drawpath(p, gp) ' want clipping now; ie within circle part below ' draw main footstool circle gp.reset() gp.addellipse(npoints(4).x, npoints(4).y, npoints(5).x, npoints(5).y) g.drawpath(p, gp) ' set picturebox value picturebox1.image = bmp

    [update] found solution using graphics.excludeclip:

    ' add together feet dim p pen = new pen(color.darkgray, 1) dim feetsize size = new size(10, 10) integer = 0 3 gp.addellipse(new rectangle(new point(npoints(i).x - (feetsize.width / 2), npoints(i).y - (feetsize.height / 2)), feetsize)) next ' clip exclude circle dim egp new graphicspath egp.addellipse(npoints(4).x, npoints(4).y, npoints(5).x, npoints(5).y) g.excludeclip(new region(egp)) ' draw result g.drawpath(p, gp) ' draw circle g.resetclip() gp.reset() gp.addellipse(npoints(4).x, npoints(4).y, npoints(5).x, npoints(5).y) g.fillpath(new solidbrush(fillcolour), gp) g.drawpath(p, gp)

    vb.net gdi

    php - MySQL query group name but display other rows with limit -



    php - MySQL query group name but display other rows with limit -

    table +----+-----+------------+ |col1|col2 |col3 | +----+-----+------------+ |a |one |1-jul-2013 | |a |two |2-jul-2013 | |a |three|3-jul-2013 | |a |four |4-jul-2013 | |a |five |5-jul-2013 | |b |one |1-jul-2013 | |b |two |2-jul-2013 | |b |three|3-jul-2013 | |b |four |4-jul-2013 | |b |five |5-jul-2013 | |b |six |6-jul-2013 | |b |seven|7-jul-2013 | |b |eight|8-jul-2013 | |c |one |1-jul-2013 | |c |two |2-jul-2013 | |c |three|3-jul-2013 | |c |four |4-jul-2013 | |c |five |5-jul-2013 | |d |one |1-jul-2013 | |d |two |2-jul-2013 | |d |three|3-jul-2013 | |d |four |4-jul-2013 | |d |five |5-jul-2013 | +----+-----+------------+

    i display this:

    +-----+------+------------+------------+------------+ |group|name |date |name |date | +-----+------+------------+------------+------------+ | |one |1-jul-2013 |two |2-jul-2013 | | b |one |1-jul-2013 |two |2-jul-2013 | | c |one |1-jul-2013 |two |2-jul-2013 | | d |one |1-jul-2013 |two |2-jul-2013 | +-----+------+------------+------------+------------+

    why want that? having same column names next each other makes bit hard figure out 1 need. far know, it's not possible have duplicate column names.

    php mysql group

    javascript - Bug in autosize.js of textareas when loading value from PHP -



    javascript - Bug in autosize.js of textareas when loading value from PHP -

    i trying create web-form has alternative reload saved data.

    the problem when big string of text entered autosized textarea has been saved , reloaded adds big amount of white space text area. [see before save, , after load pictures below]

    before save:

    after load:

    the form info loaded php injection of value in next example:

    <textarea class='animated' name="coursetitle" id="coursetitle"><?php echo ($_post['coursetitle']) ?></textarea>

    the form can seen in link. http://pansycheung.com/forms/newcourseproposal.php?c2ef=0

    and info can loaded form in table below (found @ bottom of form page).

    load table:

    select first file load

    "phillip test eecs3603"

    the white space disappears when doing 1 of following.

    type test area or adjusting zoom in browser

    any help debugging suggestions fantastic.

    go ttp://pansycheung.com/forms/newcourseproposal.php?c2ef=0 test form.

    thank you!!!

    using jquery, did seek 'triggering' autosize?

    $('#coursetitle').trigger('autosize.resize');

    you have initialize autosize;

    $('#coursetitle').autosize();

    if still doesn't work seek putting 'trigger' autosize in settimeout();

    settimeout(function(){ $('#coursetitle').trigger('autosize.resize'); }, 1000);

    javascript php html whitespace autosize

    javascript - Button click in iFrame on Page Load -



    javascript - Button click in iFrame on Page Load -

    i have embedded iframe (a map) , need search button clicked on page load display search results. when clicking search button on map action not alter url.

    has tried action before , possible? button has id="search1" , scripts have tried below. first basic doc ready , sec sets delay (i hoping 1 time map loads script fire , initiate search).

    <script> $(document).ready(function () { document.getelementbyid("search1").click(); }); </script> <script> $("document").ready(function() { settimeout(function() { $("#search1").trigger('click'); },20); }); </script>

    javascript jquery

    How do I check if a user has 2-factor authentication enabled via Google Admin SDK APIs -



    How do I check if a user has 2-factor authentication enabled via Google Admin SDK APIs -

    i using google admin sdk apis manage users (create/update) in our organization's google apps account. allow users optionally utilize 2-factor authentication feature , i'd able determine if business relationship has enabled or not when 1 of our internal back upwards reps looks account. looking on docs @ https://developers.google.com/admin-sdk/directory/v1/reference/users, not see attributes indicate setting.

    is there way me check if enabled via api?

    saw reply old stackoverflow post:

    find google apps users not using two-factor authentication

    you can find info via reports api of admin sdk: https://developers.google.com/admin-sdk/reports/v1/reference/usage-ref-appendix-a/users-accounts

    hope helps!

    google-admin-sdk google-directory-api

    php - How to prevent update query from automatically running till open modal -



    php - How to prevent update query from automatically running till open modal -

    i have been using this modal script run query on page. however, when set update query in modal content box, automatically runs 1 time page loaded. however, want run 1 time user opens modal box. so, here modal box code far:

    <div class="md-modal md-effect-1" id="modal-1"> <div class="md-content"> <h3>success!</h3> <div> <?php $id = $_get['id']; $query = $db->query("update mybb_tnybracket set player2 = '$username' tid = '$id' , player1 not null , player2 null")or die(mysql_error()); ?> <p>content has been updated!</p> <button class="md-close">close me!</button> </div> </div> </div> <button class="md-trigger" data-modal="modal-1">update information?</button>

    i unable find way create query wait until modal open. makes sense why automatically run query, need hold off until it's opened! can seem help?

    php jquery mysql

    javascript - Google's shebang #! syntax for ajax crawling not resulting in crawled pages -



    javascript - Google's shebang #! syntax for ajax crawling not resulting in crawled pages -

    i have site has implemented google's shebang '#!' syntax ajax crawling.

    both sides of scheme have been implemented discussed @ https://developers.google.com/webmasters/ajax-crawling/docs/specification

    in other words, urls ajax-created page such as: http://avianguitars.ca/configurator/#!s mapped static html versions cached server side @ http://avianguitars.ca/configurator/?_escaped_fragment_=s

    google should see #! syntax, crawl _escaped_fragment_ version, , display on google original http://avianguitars.ca/configurator/#!s url.

    i have added urls in format http://avianguitars.ca/configurator/#!s site's sitemap, submitted through google's developer tools, !# urls appear ignored , still not indexed.

    another illustration of 'shebanged' url http://avianguitars.ca/configurator/#!action=showline&lineid=46 maps http://avianguitars.ca/configurator/?_escaped_fragment_=action%3dshowline%26lineid%3d46

    all other (non-ajax) urls submitted via sitemap accepted, , assume general crawling have picked urls too.

    is there obvious missing preventing links beingness indexed?

    yes, have missed something. need add together <meta name="fragment" content="!" /> tell shebang url uses identifier fragment.

    this tell more on side of google: https://developers.google.com/webmasters/ajax-crawling/docs/specification

    javascript php ajax url google-ajax

    sitecore7 - Sitecore TDS Deployment Property Setup Guide -



    sitecore7 - Sitecore TDS Deployment Property Setup Guide -

    we using tds 5.0 sitecore 7.2 solution.

    could please help best practices following?

    which config take current config? which kid sync state take , items? which deploy setting take items?

    basically i'm after best practices has worked project experience.

    thanks.

    the settings take tds project setup have lot of solution is. next best practices use:

    current config:

    this value based off build configurations. typically have debug, test, , release configurations, each configuration corresponds different deployment environment (your test sever, production server, etc.) set setting each item based on whether want item deployed in particular configuration. e.g. utilize current config - exclude not include test info items in release/production build.

    child sync state:

    the value utilize depend on item , particular intentions of solution.

    for template items, best create sure child sync - children used, why template modifications create picked when perform sync operation.

    for items under content tree (/sitecore/content), value utilize vary based on purpose of item. if illustration site has folder item news items, set kid sync state news folder child sync - no sync unlikely new items create in development environment needs automatically synced project.

    if need sync direct children of item , not children's children (descendants) utilize child sync - direct descendants option.

    deploy:

    use deploy - once bulk of items in tds project. tell generated bundle deploy item if doesn't existing in database beingness installed to. means can ensure solution critical items nowadays in target environment, if have been modified in environment, bundle not overwrite existing changes.

    such illustration home page item website. want create sure there, have been modified content authors between releases.

    use deploy - always if want bundle overwrite existing item in target environment values have in source control. best not utilize setting on items content authors editing, otherwise lose of info occur making content authors upset.

    additional: utilize deploy - always on template items since assumption template items in source command required create tested solution work. hence want override changes made in target environment ensure have stable instance.

    sitecore sitecore7

    asp.net mvc 4 - YUI and Purecss button color -



    asp.net mvc 4 - YUI and Purecss button color -

    i'm created simple css yui skin builder, but, when seek utilize in mvc project color scheme not correct

    my skin that: skin, spected button color red, but, grayness or bluish button:

    my cshtml code:

    @{ layout = null; } <!doctype html> <html lang="pt-br"> <head> <meta name="viewport" content="width=device-width" /> <title>uniflex</title> <link href="@url.content("~/css/pure/pure-min.css")" rel="stylesheet" /> <link href="@url.content("~/content/pure-skin-min.css")" rel="stylesheet" /> </head> <body> <div style="margin-top: 60px;margin-left:auto; margin-right: auto;width:330px;"> <img src="@url.content("~/imagens/logo.png")"> </div> <div style="width:500px; margin-right:auto; margin-left:auto;"> <form class="pure-form pure-form-aligned"> <fieldset> <div class="pure-control-group"> <label for="name">usuario:</label> <input id="name" type="text" placeholder="username"> </div> <div class="pure-control-group"> <label for="password">senha:</label> <input id="password" type="password" placeholder="password"> </div> <button class="pure-button pure-button-primary">a pure button</button> </fieldset> </form> </div> </body> </html>

    what wrong ?

    ok, forgot set css name in body

    <body class="pure-skin-mine"> <!doctype html> <html lang="pt-br"> <head> <meta name="viewport" content="width=device-width" /> <title>uniflex - bradesco</title> <link href="@url.content("~/css/pure/pure-min.css")" rel="stylesheet" /> <link href="@url.content("~/content/pure-skin-mine.css")" rel="stylesheet" /> </head> <body class="pure-skin-mine"> <div style="margin-top: 60px;margin-left:auto; margin-right: auto;width:330px;"> <img src="@url.content("~/imagens/bradesco-logo.png")"> </div> ...

    now it's work well!

    asp.net-mvc-4 yui-pure-css

    Accessing this variable in jQuery plugin -



    Accessing this variable in jQuery plugin -

    i'm trying access "this" variable in plugin maintain getting error uncaught referenceerror: $self not defined. don't understand i'm doing wrong , first time i've tried building plugin way.

    i've looked @ other plugins follow pattern i'm not seeing i'm missing compared theirs.

    codes:

    ;(function($) { $.fn.videopagination = function(method) { // method calling logic if (methods[method] && method.charat(0) != '_') { homecoming methods[method].apply(this, array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { homecoming methods.init.apply(this, arguments); } else { $.error('method ' + method + ' not exist on jquery.videopagination'); } }; var methods = { init: function(options) { var o = $.extend({ per_page: 12, current_page: 1, src: '/videos.json' }, options || {}); var $self = $(this); $self.data('videopagination', o); methods.cover(); homecoming this; }, cover: function() { $self.find('article').each(function(i) { var video = $(this); settimeout(function() { video.fadeto(250, .2); }, 50*i); }); } }; })(window.jquery); $('.videos').videopagination();

    the problem not utilize of this scoping of $self variable, see comments added below:

    var methods = { init: function(options) { var o = $.extend({ per_page: 12, current_page: 1, src: '/videos.json' }, options || {}); var $self = $(this); //you defining $self variable here within scope of init function $self.data('videopagination', o); methods.cover(); homecoming this; }, cover: function() { $self.find('article').each(function(i) { // trying utilize here within scope of cover function. var video = $(this); settimeout(function() { video.fadeto(250, .2); }, 50*i); }); } };

    instead need declare variable in larger scope can set , access in both locations:

    (function($) { $.fn.videopagination = function(method) { // method calling logic if (methods[method] && method.charat(0) != '_') { homecoming methods[method].apply(this, array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { homecoming methods.init.apply(this, arguments); } else { $.error('method ' + method + ' not exist on jquery.videopagination'); } }; var $self; //notice $self declared outside of both functions. var methods = { init: function(options) { var o = $.extend({ per_page: 12, current_page: 1, src: '/videos.json' }, options || {}); $self = $(this); $self.data('videopagination', o); methods.cover(); homecoming this; }, cover: function() { $self.find('article').each(function(i) { var video = $(this); settimeout(function() { video.fadeto(250, .2); }, 50*i); }); } }; })(window.jquery); $('.videos').videopagination();

    jquery

    google drive sdk - Reason[internalError] Domain[global] ] -



    google drive sdk - Reason[internalError] Domain[global] ] -

    i'm getting tones of these generic errors in solution while accessing google drive service via sdk.

    can provide pointers why these errors happening? part solution works randomly these exceptions pop up!

    maybe if can email back upwards straight great :)

    also, on lastly hr i've received in excess of 600 occurrences of exception , need resolve it!

    google-drive-sdk

    java - How to change the M2_REPO of Maven in windows -



    java - How to change the M2_REPO of Maven in windows -

    currently,i have alter device(laptop) working ---> have alter environment suitbale project.

    however, got issue relating setting m2_repo home.

    at first, m2_repo beingness set default local in c such below :

    however, want alter m2_repot other local such :

    i set m2_repo in environment still don't work well.

    please tell me know config them ( supposing using eclipse our project)

    thanks.

    oh. simplest soltion here : check next screen check if have settings, go here go window->preference , type maven in type filter

    java eclipse maven

    javascript - Meteor conditional CSS -



    javascript - Meteor conditional CSS -

    how can set background-color: #ccc {{colorlike}} helper? colour used list items.

    <template name="viewpost"> names: {{#each usernames}} <li class="name"><a class="{{colourlike}}" href="{pathfor 'viewitem'}" >{{name}}</a></li> {{/each}} </template>

    i register helper {{colordislike}} in bacground-colour: #fff. that if element exists in particular field, {{colourdislike}} over-ride {{colorlike}}. i'm gathering can accomplish 'if' statement.

    template.viewpost.helpers({ usernames: function(){ var selectedpostid = session.get('postid'); var arrayoflike = posts.find({_id: selectedpostid}, {fields: {likes: 1}}).fetch(); var sumarray = _.chain(arrayoflike).pluck('likes').flatten().value(); homecoming meteor.users.find({_id: {$in: sumarray}}); }, });

    the selected post session set template created upon clicking post title. when clicked, user can see list of usernames of liked post. i'm aiming these names <li class="name"><a class="{{colourlike}}" href="{pathfor 'viewitem'}" >{{name}}</a></li> in colour.

    when user clicks name, able view 'item' field in particular user profile on viewitem template. template displayed button 'dislike' item. if so, userid of item stored in 'dislike' field of post document.

    <template name="viewitem"> {{profile.item}} <div class="dislike"> <button type="button" class="btn btn-default btn-lg"> <span class="glyphicon glyphicon-remove"></span> dislike </button> </div> </template>

    the idiomatic way apply semantic class - e.g. "liked" or "disliked" - in css, apply background colour elements class.

    class="lang-html prettyprint-override">{{#each likingusers}} <li class="name"><a class="liked" href="{{pathfor 'viewitem'}}" >{{name}}</a></li> {{/each}} {{#each dislikingusers}} <li class="name"><a class="disliked" href="{{pathfor 'viewitem'}}" >{{name}}</a></li> {{/each}}

    here likingusers same usernames helper wrote, , dislikingusers similar, gets users disliked instead.

    class="lang-css prettyprint-override">/* css */ a.liked { background-color: #ccc; } a.disliked { background-color: #fff; }

    this way, if later decide style liked/disliked posts differently - e.g. create liked posts green, or set strikethrough on disliked posts - have alter css, not js code or html templates.

    javascript css meteor spacebars

    android - Is language conditional in some operations? -



    android - Is language conditional in some operations? -

    i'm developing app utilize geocoder place's coordinates.

    the operative this:

    the user defines address. the geocoder finds address , coordinates address. this coordinates in decimal format , need them in degrees-minutos format them.

    to format coordinates decimal degrees-minutes use:

    string frmtlatitude = location.convert(double.parsedouble(lat), location.format_minutes);

    so, if have illustration latitude 43.249591 in decimal value, returns 43:14.97546.

    after this, have create operations latitude appearance: 4314.975

    when operations, 1 of them split value using ".". split 14.97546 in 1 hand 14 , in other 97546.

    until here, ok. works fine when have phone's language selected in english. if select in spanish, app crashes. have followed stacktrace , points there. in english language when using first commented function convert decimal degrees-minutes separates decimals "." if have in spanish, separates them ",".

    can happen or cause thing?

    we can @ source code of convert method

    public static string convert(double coordinate, int outputtype) { if (coordinate < -180.0 || coordinate > 180.0 || double.isnan(coordinate)) { throw new illegalargumentexception("coordinate=" + coordinate); } if ((outputtype != format_degrees) && (outputtype != format_minutes) && (outputtype != format_seconds)) { throw new illegalargumentexception("outputtype=" + outputtype); } stringbuilder sb = new stringbuilder(); // handle negative values if (coordinate < 0) { sb.append('-'); coordinate = -coordinate; } decimalformat df = new decimalformat("###.#####"); if (outputtype == format_minutes || outputtype == format_seconds) { int degrees = (int) math.floor(coordinate); sb.append(degrees); sb.append(':'); coordinate -= degrees; coordinate *= 60.0; if (outputtype == format_seconds) { int minutes = (int) math.floor(coordinate); sb.append(minutes); sb.append(':'); coordinate -= minutes; coordinate *= 60.0; } } sb.append(df.format(coordinate)); homecoming sb.tostring(); }

    we can see uses decimalformat given pattern. so, if decimalformat constructor :

    public decimalformat(string pattern) { // applypattern after symbols set this.symbols = new decimalformatsymbols(locale.getdefault()); applypattern(pattern, false); }

    we can see here if give pattern, uses locale values. javadoc said :

    parameters:

    pattern non-localized pattern string.

    to finish, can go here see different local variant of numbers representation : http://docs.oracle.com/cd/e19455-01/806-0169/overview-9/index.html

    so can see us-english utilize "dot format" , spanish utilize "comma format".

    to reply question : proflem you're facing due decimal format of locale. advice careful when converting types of objects create manipulation on them. converting int string should display it.

    i think should seperate decimal part of number when stills float (or decimal type) , convert object string display it. can take @ math class or search illustration on how ;)

    also, @dmitry said, can decimalseparator decimalformatsymbols.getdecimalseparator().

    sources

    location.convert(double,int) source code

    decimalformat(string) source code

    java "decimal , thousands separators"

    android

    oauth - oauth2.0 implemenation for providers -



    oauth - oauth2.0 implemenation for providers -

    can help me examples of oauth implementation providers. have sample web application , want provide oauth other clients application. help appreciated. using illustration sample httpserveletrequest shows null

    http://blogs.steeplesoft.com/posts/2013/07/11/a-simple-oauth2-client-and-server-example-part-i/

    thanks..

    you can find in "libraries, products, , tools" page of openid connect website. loosely speaking, in context of openid connect, identity provider oauth provider. so, solutions marked "identity provider: yes" in page oauth providers.

    if don't mind delegating "authorization" part external server (authlete), source code examples of oauth provider can found @ github.

    authlete/java-oauth-server

    detailed generic info developers have implement oauth 2.0 , openid connect can found in authlete definitive guide.

    oauth jersey oltu

    Why instance field of 'enum' is 'enum' in java? -



    Why instance field of 'enum' is 'enum' in java? -

    for below typeandsize class,

    class typeandsize { species type; // runtype empty, shark, or fish int size; // number of cells in run runtype. enum species{empty,shark,fish} /** * constructor typeandsize of specified species , run length. * @param species ocean.empty, ocean.shark, or ocean.fish. * @param runlength number of identical cells in run. * @return newly constructed critter. */ typeandsize(species species, int runlength) { if (species == null) { system.out.println("typeandsize error: illegal species."); system.exit(1); } if (runlength < 1) { system.out.println("typeandsize error: runlength must @ to the lowest degree 1."); system.exit(1); } this.type = species; this.size = runlength; } }

    with usage of fellow member fields of enum class type in below code,

    class runlengthencoding { ... public runlengthencoding(int i, int j, int starvetime) { this.list = new dlist2(); this.list.insertfront(typeandsize.species.empty, i*j); .... } ... }

    let me inquire question.

    my question: why fellow member field of enum class designed instance of enum? because of ease in passing on parameters of enum class type can backward compatible old concept of enum in c language collection of constants? reason?

    what talking (typeandsize.species.empty) not fellow member field of spicies. when talk "member field", implies instance variable (for possible write in enum in java).

    in aspect asking, can interpret enum beingness special shorthand of writing special class class constants:

    enum foo { a, b; }

    is similar

    class foo { public static final foo = new foo(); public static final foo b = new foo(); private foo() {} }

    (there still lot of difference between enum , handcrafted class, not yet concern)

    java enums

    RabbitMQ: Route based on Header + Routing Key -



    RabbitMQ: Route based on Header + Routing Key -

    is there way bind queue exchange combination of routing key plus header value(s)?

    thanks

    no, not possible mix routing logic, @ to the lowest degree 1 exchange (see explanation , workaround below).

    each exchange type has own routing mechanism, headers , topic exchanges (as others) logic can't mixed.

    if sure need @ same time routing key , headers routing, can seek play exchange exchange binding (here explanation how works: exchange exchange bindings in rabbitmq blog).

    p.s.: improve if explain problem trying solve, while looks complicate things (behavior you've asked not common).

    rabbitmq