Friday, 15 February 2013

Can applications hosted in IIS Express utilize SQL Server aliases? -


I have a web-API project that is configured with a connection string that contains data for the alias defined in SQL Server The source set configures the manager. The server is running fine when it launches through Visual Studio 2013, but when it launches as a separate process by using% PROGRAMFILES% \ IIS Express \ iisexpress.exe, it fails to connect and Eventually with error:

System ComponentModel.Win32Exception (0x80004005): Network path not found

The procedure works as expected if the connection string was modified to specify the actual server go (Eg local host)

I searched the question asked on a redgate forum, which indicates that at least one other person has also met with this issue.

if statement - Possibilities to short if-conditions in Java -


If I want to reduce it

  if (x) {x = false; } And {x = true; }  

I use the following code:

  x =! X;  

But what if I want to reduce this code? Is there a way to do that? if so, how?

  if (x) {method_1 (); } Other {method_2 (); }  

Can you use? : Statement

  x? Method_1 (): method_2 ()  

And sometimes, it is more readable to divide it into multiple lines:

  isSomethingTrue? Method_1 (): method_2 ()  

* Edit

To be accurate, as others have commented, you specify a return value in some variables Will happen. So the bit of code will actually look like this:

  someVar = isSomethingTrue? Method_1 (): method_2 ()  

means that you can not do it in invalid ways


php - Creating MySQL backup from admin panel -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 5 जवाब

मुझे एक बटन बनाने की आवश्यकता है मेरे व्यवस्थापक पैनल में जब क्लिक किया जाता है, तो एक डीबी बैकअप उत्पन्न होता है।

मुझे बिना किसी कमांड लाइन या phpMyAdmin निर्यात के उपयोग करने का तरीका ढूंढने लगता है।

बटन php के साथ किया जाना है, या कोई अन्य विकल्प।

कोई भी मदद या सलाह या कम से कम एक विचार का स्वागत किया जाएगा।

android - Handling camera and user rotation -


I am going through a lot of answers, but there is a code that I do not know in which direction to choose. I hope someone can point me in the right direction.

I have a custom camera app where I show the preview ( SurfaceHolder ) from the front or back camera. I have a button where the user can rotate the preview image for 90/180/270 degrees. This value is saved and applied to the camera and the preview image.

Although the orientation of the images the users take, the picture is not the same. My question is how do I account for user and device orientation so that the output image can be rotated just like the preview image?

A possible direction (if you are on Android studio) by dragging the code, step by step and its The requirements will be to modify. It certainly does not 'do whatever your app' does, but it can get you off-the-ground (or you can get even more confused). And look, IT handles only rear CAM anyway, a small front of information.

1 / When your activity begins (on cret), record your rotation and lock it so that you do not see the view at any time while transferring your phone. Depending on your initial position, your orientation port or land may be. You can also 'force it' for LAND, for example, but when your activity begins, it will look jerky.

2 / onSurfaceChanged gives you the size of your surface. It can be PART (WLT; H) or Land (W> H) You can send the camera manager W, H to your camera manager to choose the ideal preview size. Since 'getSupportedPreviewSizes' most types (I would always like to say, but not 100% fixed) according to type of land (W> H), you swap your surface W and H.

3 / don does not forget about 'set display ormentation' in your initial orientation, so your preview is not sideways.

4 / Approximately, your surface W is not equal to one of the proposed preview sizes: h, resulting in crushed / enhanced preview (just look at any object with you Cam preview). So now you have to adjust the flat shape again, look at the 'set layout side' at the end of the 'size of the surface'. It is worth noting that you can either adjust the surface for a fit-in (letterbox), as a result the sides may have two background colored bandages, or fill (pan and scan) to fill your entire surface. Some of your screens (which cares)

This helps you correct the preview. I should also mention that there is another quote with preview orientation. Some tablets (Nexus 1 genes, ...) have natural orientation land, but some (such as Samsung 8 3.0) have a port in it. This problem is adjusted during the initial time and expresses itself in the 'isLandTab' boolean.

5 / Now, when you finally get your picture from camera.gate, then you move it back using the same amount. You revolve your preview rather expensive operation (memory-wise). You have to do it in the bitmap, rotate and ... whatever you want to do. Again, shrink, show, ....

Now, when you finally meet through this nonsensical rant, you can ask yourself. Is it not better that you launch activity in the land, lock it in this case?

  1. To swap it does not want W, H
  2. Display Orientation Set Do not
  3. Do not want to rotate the image after receiving the image.

You need to adjust the surface size of the shape to fit in proportion to the proposed / selected preview, as well as to dance.

Have fun, good luck


mysql - geographic database structure -


I have a geographical DB in mysql with more than 15m records so far every record has a field Parent_id : For example in Tuscany Italy has parent_id . It is a tree, but it is garbage

Unfortunately this

  • get all the leaves for all the nodes
  • Get all the descendents of the node
  • Receive immediate children of nodes
  • 1 and 2 can be obtained with nested set structure, 4 actual With the structure. I do not know how to deal with the third

    Unfortunately the nested set structure is not able to add and add nodes.

    So here's the question:

    1. How do you get it structured?
    2. Will you keep using mysql? Something better?
    3. Have you not given any advice about moving the actual DB into the new one?

    In addition, DB Infos must also be through this flexible checker, do you think it is better to build and structure DB directly? if so, how?


    More Confusion With OOP in Python -


    Why do I have to give the song to print as 4 for x but not for two strings? I finally understand the parameters and satisfy them, but I do not know how to print songs for X in addition to the BulldogOnPerd and MemoryContents other than memory address.

      class song (): def __init __ (self, song, x): self.lyrics = lyrics # self.x = x def sing_me_a_song (self): for the line in self: print Line def print_x (self): print x.lyrics happy_bday = song (["Happy birthday to you", "I do not want to sue", "I will stop there"], 'x-value') bulls_on_parade = song ["They will rally around the family", "packets full of shells"], 'x-value'] happy_bound. Sing_me_a_song () bulls_on_parade.sing_me_a_song () def song (args): pass x = song (song = 4, X = song) x come in this snippet of code    

    being a function. x lyrics for code> will pass this address to work (this is not entirely true, but for now, do it) to x as the value of the parameter.

    Bol = 4 is different because the Python function separates between call logic names and variable names.

      def song (args): pass x = song (song = 4, x = song)  

    In fact, if you do this in your code

     

      x = song (song = song) print x.lyrics  

    You will see something like this:

    < Pre> & lt; Function song 0x107b9d1b8 & gt;

    websocket - PrimeFaces Notify -


    I am trying to implement primfolks I applied the exact code shown in the linked example but every The times when I try to run it, I get the following error in the web console.

      Websocket failed. Downgrading the comet and resetting the push. Js.xhtml? Ln = Primefaces & amp; V = 5.1: 1 get http: // localhost: 8080 / notify / primepush / notify? X-Atmosphere-Tracking-ID = 0 & amp; ... NG and X-Atmosphere - TrackMessageSize = True and X-Atom Protocol = True & amp; I have satisfied all the dependencies for Primetime 5.1 and JSF 2.2.6. I'm really stuck on this one, I can not understand what I'm missing.   

    I think your problem is here.

    Include this among the UI in your .xhtml file: Define and script tags

       
      Public invalid execute group message () {RequestContext.getCurrentInstance () . Execute ("doGrowling ();"); }  

    c# - Calculate number of cells with a specific value -


    I am creating a program for test management, which has a statistics function, which calculates the number of bugs fixed Is not fixed, or N / A test cases are all listed on a datagrid view, where the first column is for test cases, the second is for a result (the column I want to work with) And later for comment only. This is a little bit of my code, to show what I'm talking about

      private int passed () // This method assumes how many tests The cases have passed {int pass = 0; If (/ * what condition should I put here? * /) {Pass ++; } Return pass; } // Is this the best way to display percentages in real time? Private Zero RefreshTech (Object Sender, EventErgus E) {Display2.Text = passed (). ToString (); } "Result" column cells each have a blanket-box whose objects are "fixed", "N / A" and "not fixed". Please, I would like to know how I can program the value of those cells and then how many bugs have been fixed, use them as a condition for this count.   

    You should get an answer by shuffling through all the rows in the gridview.

      int countFixed = 0; Int countUnFixed = 0; For (int i = 0; i & lt; dgv.rowCount; i ++) {if ((string) dgv.Rows [i] .cel [1] .Value == "fixed") // column names Referring to cells from and not indexFix ++; Else if ((string) dgv.Rows [i] .cel [1]. Value == "is not fixed") countUnFixed ++; }  

    slider - animation functions JQuery -


    I'm breaking my head on this. I have the following code:

      & lt; Html & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "bannerTest.css" & gt; & Lt; Script type = "text / javascript" src = "http://code.jquery.com/jquery-1.4.2.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div class = "banner" id = "box" & gt; & Lt; Script & gt; $ (Document) .ready (function () {setTimeout (function () {$ ("# box"). ({Height: "300px"}) $ ("# box"). Animate ({width: "100 % "});}, 100);}); & Lt; / Script & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

    css

     . Banner {background: # 98bf21; Height: 100px; Width: 100px; Margin: 6px; }  

    OK, so when the page has set the slide slide down, and later it is horizontally inside a div tag

    It looks like this:

    So if I want to now have a blue square that slides down too Does, how should I do this?

    What would I like:

    I was thinking that I I can create a new div, but certainly did not work. I tried to do something like that, but I also need a "baibabox" style, but I think something is wrong. Something I think is wrong.

      & lt; Div class = "banner" id = "box" id = "leftbox" & gt; & Lt; Script & gt; $ (Document) .ready (function () {setTimeout (function () {$ ("# box"). ({Height: "300px"}) $ ("# box"). Animate ({width: "100 $ {"}); $ (" # Leftbox "). Animate ({width:" 10% "}}}}, 100); // 1000 milliseconds is delayed;); & Lt; / Script & gt; & Lt; / Div & gt;  

    ; & Lt; Top & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "bannerTest.css" & gt; & Lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div class = "banner" & gt; & Lt; Div class = "banner-blue" & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("banner"). Animate ({height: "300px"}, 1000); $ ("banner"). Animate ({width: "100%"} , 1000); $ ("banner-blue"). Animate ({height: "300px"}, 1000);}); & Lt; / Script & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;

    CSS:

     . Banner {background: # 98bf21; Height: 300px; Width: 300px; Margin: 6px; }. Banner-blue {background: # 0000ff; Status: Completed; Width: 300px; }  

    If I understand you correctly, you want green The box will be parked and blue to expand horizontally and horizontally.

    Here is a work JSFiddle that has a solution:

    In your code, you have the following:

      & lt; Div class = "banner" id = "box" id = "leftbox" & gt;  

    Two things about ID:

    • You can only have one copy element
    • Need for ID is unique, therefore You have two elements with the ID of 't box

      I have used sections of the ID instead of selectors because it keeps your elements clean and You do not have to declare both and a class.

      I would also suggest that you organize your pages instead of the elements by placing all of your tags at the top of the page.

      I know that this is what you were trying to achieve.

      UPDATE

      I have the banner-blue animation in callback, meaning it only banner animation After the expiration:

        $ (document) .ready ({Width: "100%"}, 1000, function () ($ (".") {$ ( Banner-blue "). Animate ({height:" 300px "}, 1000);});});  

    xaml - custom attached property not found -


    I want to apply a new property (named "menufigure") for the pivot element, in order the color of the pivot item Change Header via a Defined ControlTemplate

    That's why I created a new category for custom property, #include the required code-in the xaml.h file and included a new namespace ("xamlns: cap") defining custom assets According to the namespace.

    PivotProperties.h

      #pragma is once using the namespace Windows :: UI :: Xaml; Namespace Custom Attachment Properties {Public Reef Class PivotProperties Sealed: Windows :: UI :: XML :: DependencyObject {Public: Fixed Windows :: UI :: Color GetMenuForeground (UIElement ^ obj); Fixed Zero SetMenuForeground (UIElement ^ obj, Windows :: UI :: Color value); Static Property Dependency Property ^ MenuForldproperty {Dependency Property ^ Mill () {Return _ManuForFrintProperty; }} Personal: Fixed Dependency Property ^ _menuForegroundProperty; }; }  

    PivotProperties.cpp

      #include "pch.h" # include "PivotProperties.h" namespace custom attachment prototypes; DependencyProperty ^ PivotProperties :: _ menuForegroundProperty = DependencyProperty :: Register Attached ("MenuAforg", Windows :: UI :: Color :: TypeID, Windows :: UI :: XML :: Controll :: Pivot :: Typied, Refused New Property Metatata ( Falls);) Windows :: UI :: Color PowoteProperty :: GetMenuForeground (UIElement ^ obj) {Return (Windows :: UI :: Color) obj- & gt; GetValue (_menuForegroundProperty); } Zero PivotProperties :: SetMenuForeground (UIElement ^ obj, Windows :: UI :: Color value) {obj- & gt; SetValue (_menuForegroundProperty, value); }  

    To use a new property for a pivot element, I declared a new xml name in the original element like the following element

      & Lt; Page / / ... ... xmlns: cap = "clr-namespace: custom attachproperties" & gt;  

    But if I try to use the new property ...

      & pivot x: name = "pivot" cap: PivotProperties.MenuForeground = "Red" & gt; ... & lt; / Axis & gt;  

    ... an error occurs, saying: "The attachment property was not found in the 'MenuForeground' type 'PivotProperties'.

    How to fix it?

    The third parameter of the method should be ownerType

    The type of owner who is entering the dependency property

    is not the type of object where you want to set the asset.

    Then your declaration should appear Like this:

      Dependency Props PtProperties :: _MenuFrintipi = Dependency Property :: Register Attached ("MenuForGround", Windows :: UI :: Color :: Typied, PivotProperties :: Typied, // Here Reef New Property Matadata (False));  

    Please also keep in mind that your PivotProperties goes from class DependencyObject , as long as it declares only the attached asset.

    You may also consi have other properties such as Background and Aug While Rbhumi > Windows.UI.Xaml.Media.Brush using afraid to use.

    >

    r - How to include nmath.h? -


    मैं अपने c nmath.h को शामिल करना चाहूंगा R_FINITE और ML_ERR_return_NAN को खोजने के लिए> कोड (एक आर पैकेज में)। मुझे पता चला कि कोई भी nmath.h को सीधे शामिल नहीं कर सकता R_FINITE को ढूंढने के लिए, मैं R_ext / libextern.h शामिल कर सकता हूँ। लेकिन मुझे नहीं पता कि इसमें क्या शामिल है ताकि ML_ERR_return_NAN मिल जाए कोई विचार? मैंने पाया कि प्रोफेसर ब्रायन रिप्ले ने लेखन आर एक्सटेंशन का संदर्भ दिया है, लेकिन मुझे nmath.h को संबोधित किया जा रहा है (जहां बिल्कुल?)

      sudo apt-get r-mathlib स्थापित करें  

    class = "post-text" itemprop = "text">

    उसके बाद आप इस तरह के परीक्षण कार्यक्रमों का निर्माण कर सकते हैं:

      // - * - मोड: सी ++; सी इंडेंट स्तर: 4; सी-बुनियादी-ऑफसेट: 4; // compile-command: "gcc -s-wall-o3 \ // -i / usr / share / r / include -o rmath_rnorm \ // rmath_rnorm.c -lRmath -lm" - * - // से तुलना करें $ रूक्रिप्ट-ई "आरएनजीडैंड ('मार्सग्लिया'); \ //। यादृच्छिक। सीड [2: 3] & lt; - c (123L, 456 एल); rnorm (2)" // [1] -0.2934 974 -0.3343770 # शामिल & LT; stdio.h & gt; # परिभाषित MATHLIB_STANDALONE 1 # शामिल हैं & lt; Rmath.h & gt; Int मुख्य (शून्य) {सेट_सीड (123, 456); Printf ("rnorm:% f% f \ n", rnorm (0.0, 1.0), rnorm (0.0, 1.0)); वापसी 0; }  

    नोट: पहली सुरक्षित पंक्ति में पहली पंक्तियाँ एक-पंक्ति होनी चाहिए, फिर एमएक्स संकलन के लिए प्रोग्राम का निर्माण तुंहारे। रूक्रिप्ट अभिविन्यास: एक पंक्ति के लिए ठीक है।

    संपादित करें: ड्रेट्ज़ गलत प्रश्न का जवाब दिया गया है nmath.h से src / nmath / nmath.h से निर्यात नहीं किया जा रहा है लेकिन यह आर मैथलेब्रोरी क्या है < दूसरों द्वारा उपयोग के लिए आर कोर द्वारा निर्यात किया गया है मथलिब * / #ifndef MATHLIB_PRIVATE_H #Define MATHLIB_PRIVATE_H के संकलन के दौरान उपयोग के लिए nmath.h फ़ाइल

      / * निजी हेडर फ़ाइल के रूप में कहां है, Pre> 

    ताकि आप इसके लिए भरोसा नहीं करना चाहते।


    amazon web services - What is specifically meant by t[1|2].micro AWS instances having low I/O bandwidth? -


    What does this low I / O bandwidth interrupt mean? Does Amazon give less priority to I / O operations [1 | 2] .Micro examples?

    I am specifically asking whether Amazon / I intentionally result in limited resources of I / O T [1 | 2]. Misses example? What have I read on Amazon, between IOPS in AWS EBS-based magnetic drive 40-200; T [1 | 2]. After the MICRO example, do IOO operations provide less transportation capacity?

    This is completely confusing to me on 75-100 computers on a desktop between Iops in B / CA 7200 RPM drives.

    Thank you in advance for your help.

    ebs version There is no single drive, generally the best way to think about them is more on the pattern of the amount of a raid.

    Therefore, examples are shared on the host hardware, this means bandwidth is shared among all instances on the host available for EBS quantity. Micro instances get the lowest priority of all instance sizes.

    With a micro-insertion, even if you have a capable amount of 200 Iops, it depends how your neighbors make noise, you can not even get to him.


    javascript - how to get values of jquery select2 tags list using asp.net? -


    मैं पीछे asp.net कोड में jquery select2 प्लगइन का चयन मान प्राप्त करना चाहता हूं।

    यहाँ है मेरा स्रोत

    ग्राहक पक्ष:

      & lt; चुनें आईडी = "ddlcountry" runat = "server" class = "select" style = " चौड़ाई: 100%; "& gt; & Lt; / चयन & gt;  

    कोड पीछे:

      var query1 = सीटीएक्स में पैकेट से। देश 1 आरोही का चयन नया {pcountry.CountryId, pcountry.CountryName}; अगर (query1! = नल) {ddlcountry.DataSource = query1.ToList (); Ddlcountry.DataValueField = "देश आईडी"; Ddlcountry.DataTextField = "देशनाम"; ddlcountry.DataBind (); Ddlcountry.Multiple = सच; } सुरक्षित शून्य btnSave_Click (ऑब्जेक्ट प्रेषक, EventArgs ई) {अब मैं यहाँ सभी चयनित देश मूल्यों को प्राप्त करना चाहते हैं? }  

    कृपया मेरी मदद करो, मैं बहुत आभारी रहूंगा।

    यदि आप & lt; select & gt; तत्व को एक & lt; ASP: DropDownList & gt; नियंत्रण के रूप में नहीं बना रहे हैं, तो मुझे विश्वास नहीं होता कि आपके पास गुणों तक पहुंच होगी और "डेटा स्रोत" आदि जैसे तरीकों से आप runat = "server" विशेषता को जोड़ा गया HTML तत्वों तक पहुंच सकते हैं।

    मुझे विश्वास है कि & lt; विकल्प & gt; टैग सामान्य HTML नियंत्रण प्रकार का है मैं VB.Net के लिए छड़ी है, तो मुझे आपके लिए कुछ psuedo कोड लिखना होगा ...

      प्रत्येक ओ के लिए ddlcountry में HtmlGenericControl.Children.ofType (HtmlGenericControl का) यदि ओ विशेषताएँ ("चयनित") तो 'यहां आप "मूल्य" विशेषता (और इनरएचएमटी भी काम करता है) का उपयोग करके अपने विकल्प मान का उपयोग कर सकते हैं। अगर अगला ओ  

    यहां एक है एक ऐसे उत्तर से लिंक करें जहां मैंने एक उदाहरण उदाहरण का उपयोग करते हुए जेनेरिक नियंत्रणों के माध्यम से लूप कैसे दिखाया:


    android - Is it possible for a wearable app to detect if the user has disabled interruptions? -


    I have a wearable app that displays some additional GUI whenever displaying an incoming phone call is.

    However, if the user has configured the clock to show no interruption, then when an incoming phone call arrives, it does not display anything. Is the user an API to determine how the user has configured clock interrupt settings?

    Yes, this information was highlighted in the Notification Listener . Specifically:


    javascript - Matching multiple optional characters depending on each other -


    I want to match all valid prefixes with the other characters with the option , so that

    sub
    part.
  • Options / ABC / DF
    • Match ABC / DEF Options .
    • The subt / abc / def match does not match or only matches the sub section, not t .

    My current reggae is / ^ s (u (b (s (t (u (te?)?))?)?)?)?)?)? )?)? / , which works, though it seems a little verbose.

    Is there any better (less, verbose) to do this?

  • You can use two-step reggae

    1. Use the simple pattern to find the first word of the subject ^ (\ w +)
    2. Use the word extracted from step 1 as if your regex pattern is the word option ^ subs against

    html - Bad value ... for attribute rel on element a: The string ... is not a registered keyword -


    I am trying to debug my website, but I do not know how to get rid of these errors.

    Relative A: String Lightbox [322] is not a registered keyword on the property for the Bad Value Lightbox [322] element. I think everything is very same about these 45 errors.

    HTML

      & lt; Div class = "large-3 column" & gt; & Lt; A href = "http://timberlife.nl/wp-content/uploads/2014/09/BUITENHUIS-1.11.jpg" rel = "lightbox [318]" title = "i 40 m2 with boot" class = "cboxElement" data - Target = "Flare" & gt; & Lt; Img class = "aligncenter wp-image-705-size-medium" src = "http://timberlife.nl/wp-content/uploads/2014/09/BUITENHUIS-1.1-2-200x300.jpg" alt = "Butinehus 1.1 "Width =" 200 "height =" 300 "> gt; & Lt; Br>  

    I am using a plugin to use the lightbox on my images. I am having a problem where u has a plugin for a scroll effect Is using.

    Bad values ​​for element m_PageScroll2id attribute on a rel: string m_pagescroll2id is not a registered keyword.

    Many thanks

    donation

    In HTML5, The link types can be of value only as rel attribute

    • or
    • .

    You should see better plugins Good plugins will allow you to use valid features, such as


    asp.net mvc 4 - The "RenderSection" method has already been called -


    I have a section called "sidebar" that needs to be presented twice in my _Layout.cshtml. On PC, I want the section to be sung in the form of a left sidebar, but on mobile devices, I need to present the section as a Bootstrap Copible Nouveau.

    This only uses bootstrap 3 classes Display navs on small and extra small devices:

       

    For PC users this should be a left sidebar. It is hidden on small and extra small devices.

      & lt; Div class = "row" & gt; & Lt; Div class = "col-md-2 left-sidebar hidden-x hidden-sm" & gt; & Lt; On one hand & gt; & Lt; Nav class = "main-nav" & gt; & Lt; Ul class = "main menu" & gt; @Render section ("Sidebar") & lt; / Ul & gt; & Lt; / Neo & gt; & Lt; / One side & gt; & Lt; / Div & gt; & Lt ;! - left-sidebar - & gt; & Lt; Div class = "col-xs-12 col-md-10 material-wrapper" & gt; @RenderBody () & lt; / Div & gt; & Lt ;! -. Content-Cover - & gt; & Lt; / Div & gt;  

    I have in my thoughts:

      @section sidebar {...}  

    Calling the problem @RenderSection ("Sidebar") Multiple times with the same section name. Any suggestions on how I can fix this?


    Java - NullPointerException in Graph.java -


    I am trying to create an indirect graph read from a text file. However I keep getting a NullPointerException. This is my graph class:

    Graph.java:

      package testalgo; Import java.io.file; Import java.util.ArrayList; Import java.util.HashMap; Import java.util.LinkedList; Import java.util.list; Import java.util.Scanner; Public Class Graph {ArrayList & lt; Integer & gt; Brackets = new arreelist & lt; Integer & gt; (); Hashmap & lt; Integer, linked list & lt; Integer & gt; & Gt; Adj Stable scanner scan; Public graph (arrelist & lt; integer> vertex) {adj = new hashmap & lt; Integer, linked list & lt; Integer & gt; & Gt; (); } Public static zero main (string [] args) {try {sc = new scanner (new file ("graph1.txt")); } Hold (exception e) {System.out.println (e); } While (sc.hasNext ()) {int a = integer ParseInt (sc.next ()); Int b = integer.centre (sc.next ()); Graph G = new graph (new altreist  ()); G.addVertex (a); G.addeEgde (A, B); // this line is 46 g ADEgade (B, A) is; } Sc.close (); } Public Zero addVertex (int v) {for (int i = 1; i & lt; vertices.size (); ++ i) {adj.put (i, new linked list & lt; integer & gt; ()); }} Public void addeEgde (int v1, int v2) {adj.get (v1) .add (v2); // this line 68} public list & lt; Integer & gt; Millennibbers (int v) {return adj.get (v); }}  

    And this is an error message that I am getting:

      Exception in the thread "main" on java.lang.NullPointerException testalgo.Graph. AddeEgde (Graph.java:68) on testego.Graph.main (graph.java:46)  

    Thank you for all your help!

    I can not see anywhere where you adj map to V will return adj.get (v1) back to null as a key. You have just declared adj ; You have to populate it too.

    All I am looking for:

     for  (int i = 1; i & lt; vertices.size (); ++ i) {Adj.put ( I, new linked list & lt; integer & gt; ()); }  

    Since is open to start with siroshinu , you will not include anything in your map.

    Did you mean: / P>

      adj.put (v, new linked list & lt; integer & gt; ());  

    Instead?

    In response to your comment: You must add another entry to b in your nearest list:

      g.addVertex (a) ; G.addVertex (b); // & lt; --- You need g.addeEgde (a, b); G.addeEgde (B, A); // & lt; --- Otherwise you will find an NPE here  

    How do I read each character for each "line" in a list (in order) C# -


    I'm currently working on some code but I'm stuck. I have a text file in which the name and each name are on a new line I have read these names in a list, but I want to be able to read each letter of each line (name in the text file). If someone can help me then I would appreciate it!

    This code will load the file c: \ Temp \ test-1.txt in a StreamReader, Each line reads until it hits the EOF, and prints each letter on a new line in the console. Modify as necessary.

    Note that if your file is stored on a very long line (and actually a large file), then you have to do some extra care here to avoid memory exceptions.

      string line; (Using the StreamReader Reader = New Stream Reader ("C: \\ temp \\ test-1.txt")) (reader.Peek ()> gt1) {line = reader.ReadLine (); Foreach (Four C in line) {Console.WriteLine (C); }}}  

    sql server - Standardize SQL multiple AND/Where -


    I am trying to make the following SQLs more efficient, but I have not yet successfully what I do not have. It returns an average of 800 rows in about 2 minutes. Any suggestions I can not use temp table?

      Select POP. Account_number, ip IP_IDRRC, POP.IP_Name_Full, INFO_Default_Hmp.Date_Solicitation, INFO.BAL_PRIN_AMT, UDD.USER_DEFINED_5V_14, POP.Process_Stop_Code, POP, IP, Information, INFO_Default_Hmp, INFO_Participation_Item, POP.Account_Number = POP.Account_Number and INFO.Appl_Id from POP.Mail_Code = POP.Appl_Id and INFO.Bank_Number = POP.Bank_Number and INFO_Default_Hmp.Bank_Number = POP.Bank_Number and INFO_Default_Hmp.Account_Number = POP.Account_Number and INFO_Default_Hmp .Appl_Id = POP.Appl_Id and POP.Bank_Number = INFO_Participation_Item.Bank_Number and POP.Appl_Id = INFO_Participation_Item .Appl_Id and POP.Account_Number = INFO_Participation_Item.Account_Number and INFO_Participation_Item.Involved_Party_Id_Investor = IP.Involved_Party_Id_Investor and UDD.Account_Number = POP.Account_Number and UDD.Bank_Number = POP.Bank_Number and POP .Appl_Id = UDD.Appl_Id) AND ((POP.Appl_Id = 'FL' and POP.Account_Status_Code = 'A' more info.bol_P_Print_Amt> 0 and UDD.User_Defined_5v_14 = 'S1'))  

    Maximize usage

    P> Also, tell us which RDBMS you are using by adding that tag to your post


    jenkins - Missing command on Building a Node.js App's RPM -


    In the install command in the .spec file, I have some commands that only apply to the machine on which RPM will be installed Mainly:

      preventing% 2 pm www # The problem is here rm -rf $ RPM_BUILD_ROOT cp -r * $ RPM_BUILD_ROOT / rm -rf / home / ec2-user / APP-Name MKDIR-P / Home / Ec2-user / APP-NAME cp -r * / home / ec2-user / APP-NAME / * pm2 start / home / ec2-user / APP-NAME / bin / www  
    < P> While rpmbuild is running I get an error saying that I do not get it. Since RPM is built on a Jenkins box, it is definitely not found. I have a separate box on which RPM will be installed, and of course, pm2 is installed.

    My understanding is that the box on which the RPM has been created, does not have to be kept in the library or binary, used in the established instructions. Is that right?

    Besides, can anyone think of a better way of writing the shell script of the installed directory? This is my fire node. Js is deploying

    % install to install in a temporary location RPM will bundle them where RPM will bundle them.

    % post after installation is to run the command on the target machine.

    It seems that you are trying to stop a service, you will do this in % pre .


    css - Properties applying to children although using direct descendant selector ">" -


    मैं .class & gt; उल & gt; Li

    असल में मैं जानना चाहूंगा कि कुछ गुण हैं जो अपेक्षित काम करते हैं (जैसे border ) परन्तु अन्य text-transform <सूची> >

    मुझे पाठ कोड को "पूर्ववत करें" करने के लिए का उपयोग करने की आवश्यकता को बहुत कष्टप्रद लगता है, जिसे मैं सिर्फ पहले प्रत्यक्ष और

  • gt; बच्चा।

    डॉक्स के साथ कोई भी लिंक जो मुझे यह जानने के लिए अनुमति देगा कि यह चयनकर्ता वास्तव में कैसे काम करता है, काफी अनुचित होगा।

    यह सामान्य व्यवहार है जिसे विरासत कहा जाता है।
    कुछ सीएसएस गुण उनके माता-पिता से प्राप्त होते हैं जबकि अन्य नहीं हैं।

    वंशानुक्रम

    जब किसी तत्व पर विरासत में मिली संपत्ति का कोई भी मूल्य निर्दिष्ट नहीं किया गया है, तो तत्व उसके मूल तत्व पर उस संपत्ति के गणना मूल्य प्राप्त करता है। दस्तावेज के मूल तत्व को केवल संपत्ति के सारांश में प्रारंभिक मान दिया जाता है। []

    विरासत में मिली संपत्तियों की सूची
      अज़ीमुथ बॉर्डर-पतन बॉर्डर-स्पेसिंग कैप्शन-साइड कलर कर्सर दिशा ऊंचाई खाली-कोशिका फ़ॉन्ट-परिवार फ़ॉन्ट-आकार फ़ॉन्ट-स्टाइल फॉन्ट-वेरियंट फ़ॉन्ट-वेट फॉन्ट अक्षर-रिक्ति रेखा-ऊँचाई सूची-शैली-छवि सूची-शैली-स्थिति सूची-शैली-प्रकार सूची-शैली अनाथ पिच-रेंज पिच अमीरता बोलते-बोलते-बोलते-अंक वाले बोल-विराम चिह्न भाषण-दर तनाव बोलें टेक्स्ट-संरेखित टेक्स्ट इंडेंट टेक्स्ट-ट्रांसफॉर्म दृश्यता आवाज-परिवार की मात्रा सफेद-अंतरिक्ष विधवा शब्द-रिक्ति  

    17/03/15 को निकाला गया


    सभी संपत्ति

    यह प्रॉपर्टी सीएसएस को initial | वारिस | मूल्य:

    सीएसएस सभी लघुकोड संपत्ति यूनिकोड-बीड़ी और दिशा के अलावा, सभी गुणों को अपने प्रारंभिक या विरासत मूल्य में रीसेट करता है। []

    इस संपत्ति में वर्तमान में "उम्मीदवार सिफारिश" की स्थिति है लेकिन (सफारी को छोड़कर) इसे लागू किया है।


    उदाहरण के लिए: < / H2>

    बॉर्डर संपत्ति वारिस नहीं होती है, इसलिए माता-पिता के पास बाल तत्वों की कोई सीमा नहीं होगी, हालांकि

    लेकिन फ़ॉन्ट-आकार , रंग और टेक्स्ट-ट्रांसफ़ॉर्मेंस उन गुण हैं जो बच्चे के तत्वों के लिए वारदात करते हैं। इसलिए द्वितीय स्तर की सूची में वही माता-पिता के रूप में फ़ॉन्ट-आकार , रंग और टेक्स्ट-रूपांतरण होता है।

    निष्कर्ष:
    आप जिस चयनकर्ता का उपयोग कर रहे हैं वह सही है और केवल प्रथम स्तर की सूची के आइटम को लक्षित करता है लेकिन color जैसे कुछ गुण दूसरे स्तर की सूची आइटमों में प्राप्त होते हैं।


  • ios - String not convertible to DictionaryIndex<String, AnyObject> -


    I have a function that has a hole through an array, in which the string or dictation and a new dictionary type [String: any object] , using values ​​from the original array as keys, the section custom section is an array of objects and its method GetValue always string .

    Fencing getSectionVariables () - & gt; [String: any object] {var variable = [string: AnyObject] () for sections in sections {if given as name = section.name? String {variable [name] = section.getValue ()} and if name is given as = section.name? Name {if variables [k] == zero {variable [k] = [string: string] ()} if var dict = variables [k] in [string: string] {for (k, v) [String: string] {dict [v] = section.getValue () // This works, but it certainly copies the variable according to values ​​and defines variables [of] Does not [string: string])! [V] = section.getValue () // This line can not be found to compile}}} return variables}

    If I try to insert the variable [ K] as [string: string] , the compiler is pushing that string is not convertible to indie> lt; String, any object & gt; I'm not sure why downcasting is working and why the compiler thinks that I am trying to use alternative dictionary subscript syntax.

    Note that this project is in Swift 1.1. The common problem is that a "cast expression" does not generate an "el value" and therefore It can not be assigned. For example, consider the following simplified version of the code:

      var x = "initial" var y: AnyObject? = X (string as y) = "change"  

    You will get an error on the last line, because you can not specify "cast expression".


    angularjs - Angular UI-Router pass stateparam from JSON in repeater -


    मेरे पास एक nav के लिए एक अपराधी है:

      & lt; div class = "list- समूह बायां-एनएवी "& gt; & Lt; एक एनजी-दोहराने = "ई विभागों में। बाएं nav" ui-sref- सक्रिय = "सक्रिय" ui-sref = "{{e.value}} ({विभाग: 'एचआर'})" href = "वर्ग = "सूची-समूह-आइटम" & gt; {{e.label}} & lt; / a & gt; & Lt; / div & gt;  

    आप देखेंगे कि वहाँ एक कठिन-कोडित स्ट्रिंग है, ({विभाग: 'एचआर'})

    चूंकि मैं मूल रूप से एसआरईएफ में "एचआर" स्ट्रिंग को कड़ी मेहनत से कोडित किया गया, यह लिंक अपेक्षा के अनुरूप काम करता है और आपको एचआर के पृष्ठ पर ले जाता है मैं जो करना चाहता हूं वह JSON फ़ाइल में एक और पैरामीटर जोड़ता है और पुनरावर्तक में वह का उपयोग करता है।

      {"nav": [{"label": " फ़ाइल स्थानांतरण - एचआर "," मूल्य ":" विभागों। फाइल ट्रान्सफर "," विभाग ":" एचआर "}, {" लेबल ":" फ़ाइल स्थानांतरण - बिक्री "," मूल्य ":" विभागों। फ़िलिन्स्फर "," विभाग " : "बिक्री"}]}  

    इसलिए, जहां यह कहते हैं ui-sref = "{{e.value}} ({विभाग: 'एचआर'})" मुझे किसी भी तरह {{e.dept}} में खींचने की ज़रूरत है लेकिन सिंटैक्स को समझ नहीं सकता।


    r - Fixing dates that were coerced into the wrong format -


    I have large dates whose fault was wrongly attached.

    Data:

      id & lt; - c (1:12) Date & lt; - c ("2014-01-03", "2001-08-14", "2001-08-14", "2014-06-02", "2006-06-14", "2006-06-14" , "2014-08-08", "2014-08-08", "2008-04-14", "2009-12-13", "2010-09-14", "2012-09-14") DF & Lt; - Data. Frame (ID, Date)  

    Structure:

      Date of ID 1 1 2014-01-03 2 2 2001-08-14 3 3 2001-08-14 4 4 2014-06-02 5 5 2006-06-14 6 6 2006-06-14 7 7 2014-08-08 8 8 2014-08-08 9 2004-04-14 10 10 -12-12-12 11 11 2010-09-14 12 12-09-2014  

    The data set is included only, or should only 2014 and 2013 will contain the date 2001-08-14 and 2006-06-14 most likely 2014-08-01 and 2014-06- 06 , respectively

    Output:

      Date of ID 1 1 2014- 01-03 2 2 2014-08-01 3 3 2014-08-01 4 4 2014-06-02 5 5 2014-06-06 6 6 2014-06-06 7 7 2014-08-08 8 8 2014-08 -08 9, 2014-04-08 10 10-12-12-12 11 11 2014-09-10 12 12 2014-09-12 How can I solve this mess?   

    We can convert the 'date' column to 'date' category, year 2013, 2014 To create a logical index ('index'), remove 'year').

      df $ date & lt; - as.Date (df $ date) indx & lt; -! By using% 2013: 2014  

    lubridate in the format (df $ date, '% Y')% 2013, after removing the first two characters Dmy to convert to 'date' orbit.

      Library (LibreDet) df $ date [indx] & lt; - dmy (sub ('.. ..', '', df $ date [indx])) df # id date # 1 1 2014-01-03 # 2 2 2014 -08-01 # 3 3 2014-08- 01 # 4 4, 2014-06-02 # 5 5, 2014-06-06 # 6 6, 2014-06-06 # 7 7, 2014-08-08 # 8 8 2014-08 -08 # 9 9 2014-04-08 # 10 10 2013-12-09 # 11 11 2014-09-10 # 12 12 2014-09-12  

    android - How to store only on external storage storage/sdcard0/? -


    I want to store data on external storage and environment. GetExternalStorage directory () returns / storage / module / 0 / path and and I store the data on that directory which stores data on storage / sdcard0 / ... and / storage / emulated / 0 /

    I need to store large numbers of images on external storage. How can I apply it on external storage?

    How do I obtain external storage

    Basically the same is a nickname for Nexus 5 and any other device such as physical on any other device. There is no SD card, "external storage" means device built-in storage which emulates an SD card. Environment.getExternalStorageDirectory () will point to this location so that you are good to use this method.

    From:

    Note: Don can not be confused with the word 'external' This directory can be considered as better as media / shared storage. It is a file system that can store data in a large amount and which is shared in all applications (does not apply permissions) Traditionally, this is an SD card, but it can be used as a built-in storage device Can be implemented which is different from the protected internal storage and can be kept as a file system on the computer.


    c++ - Replace a variable, by a reference to an element of an array -


    I have a class that works properly and an integer as a flag variable (bitwise operation) Uses:

      square foo {uint32_t flags; ...};  

    I want to expand this flag to a larger size, for example 512 But I want to make the old code an agnostic work in new shape.

    I tried to do this but does not work:

      class foo {uint32_t flags_ext [16]; Uint32_t & amp; Flags = Flag_chests [0]; ...};  

    gives me a bunch of problems while asignment. e.t.c. Let me warn of possible double extinction of memory.

    The code behaves in any way to behave, but can it be a part of an UTI 32_ T array?

    Apply appropriate default, copy maker and assignment operator, and you must be good: / P>

      square foo {uint32_t flags_ext [16]; Uint32_t & amp; Flags; Fu (): Flags (Flag_ext [0]) {} // Copy Seator is not taken into account to copy the reference member Foo (Const Foo and other): Flags (Flag_dest [0]) {:: memcpy ( Flags_ext, other .flags_ext, sizeof (flags_ext)); } Cons Fu & amp; Operator = (Const fee and others) {If (this == and others) returns * This; // do _not_ 'Flags' member copy! :: Memory (Flag_ext, Other.Flags_Ast, Size (Flag_ext)); Return * This; }};  

    xcode - String does not have a member named 'text' error in Swift -


    I'm getting my let c: int? = To change the conversion.text.aut () I do not keep a member of 'text' error in the name of '[string]'. Does anybody know how the variable can be converted into integer?

    I can not seem to multiply one to c .

      @Iboutlet var pickerView1: UIPickerView! @IBootletWare TextField 1: UITfixField! @IBOOTlet Enter weak variants units: UITextField! @ IBOutlet var Reply conversion: UITextField! Var brand = ["feet from meters", "cm to inch", "mm to inch"] var conversion = ["3", "4", "5"]  

    pickerView Function

      func pickerView (pickerView: UIPickerView, didSelectRow line: Int, InComponent component: int) {if pickerView.tag == 0 {let: int? EnterUnits.text.toInt () b: int? = AnswerConversion.text.toInt () Let's c: Int? = Conversion.text.aut () Answer = (a!) * (C!) TextField1.text = brand [row] answerConversion.text = conversion [row] answerConversion.text = "\ (answer)"}  

    I noticed that you do not need .text required just try to use

      f: int? = Conversion to .nt ()  

    Oh and since conversion is an array, you have to use the string you want to use. Try to do this with something like conversion [index] (the index you want to use)

    I found another way to do the following:

      f: int = int (conversion [index] .bridgeToObjectiveC (.) IntValue)  

    Hope that helps :)


    json - How to append different shapes including images depending on data in D3.js? -


    I tried to sort it out by looking at many similar questions, but no one could solve it. I want to create a force-guided graph using this form of data from JSON-File:

      {"nodes": [{"name": "A", "imagelink": "Url-to-img", "shape-type": circle}, {"name": "b", "imagelink": "url-to-img", "shape-type": rectangle}, {"name "": "{{" Source ": 1," target ": 0," value ":" "", "imagery": "url-to-img", "shape-type": triangle}] "link" :, "Value": 1, "value": 1, "value": 1}, {"source": 2, "target": 0, "value": 1}]}  / Pre> 

    Graph nodes should be a group that includes a geometric shape ("shape-type" Is defined) in which an image is included (defined by "impecclink").

    This is the original force-layout code I have used:

      var width = 960, height = 500; Var force = D3 layout. Force (). Charge (-1000) .Link Extension (150). Size ([width, height]); var svg = d3.select ("body") Attachments ("SVG"); d3.json ("json-file.json"); Force.Node (graph.nodes). Link (graph.links) .start (); var link = svg.selectAll (". Link ") .data (graph.links) .enter () Append ("line") .attr ("class", "link"). Style ("stroke-width", function (D) {return mathematics SQL (D. value);}); Var node = svg.selectAll (".node") .data (graph.nodes) .enter (). Annexe ("g") .attr ("class", "node"). Call (force.drag); To include an image in size I have used the "clip-path method" (for example circle):  
      node.epend ("circle") (. "R" , 20) .attr ("cy", 0) .attr ("cx", 0). Style ("Fill", "White"). Style ("stroke", "black") style ("stroke width", "2"); Var clippath = node.append ('clippath'). Etter (function (d) {return ("clip-" + convert-sip (dgroup))}); Clippath.append ("circle") .attr ("r", 19) .attr ("cy", 0) .attr ("cx", 0); . ("Height", 75) .attr ("width", 75) .attr ("x", -37.5) .attr ("y", -37.5) .attr ("image") .attr ("Xlink: href ", Function (d) {return (d.Igeelink)} .attr (" clip-path ", function (d) {returns (" url (# clip- "+ d.shapetype) +") ")});  

    As you can see, my problem is that the append () - function is data-dependent. So how can I understand this?

    Thank you.

    A working child is portraying a force-guided graph with different shapes and pictures.

    I used pattern solution to include image in shapes. Now I have the following questions:

    1. How can images be centered in shapes and adjust their size to size?
    2. How to add the range of shapes?

    ios - Change NSAttribtuedString Formatting Starting at Index -


    I have a enabled with UITextView attributes, and I want to change the formatting (font / Alignment / color / etc) in the NSAttributedString from a point. In other words, there is no specific part of the underlying NSAttributedString , I want to change the copy, I just want to add the next object to UITextView , from which there are different formats. For, you can imagine a UITextVIE with a string in it, and then the user enters a new line and taps the button to increase a button. font size. The user does not want to increase the font size of everything , just starting at that point.

    Can this be done? Thank you.

    If you need precise control over the dynamic style behavior of your UITextView (And if you have> = iOS 7), then you should consider using the text kit, and specifically sub-clinging. Is one, and a.


    python create a data frame with one row by a list -


    In the dragon

    says, I have a list [1,2,3, ..., 100], and I Would like to use this list to create dataframe in which there is a row and a row value list. What is the fastest and elegant way to do this?

    List to data :

      In [11]: l = Category (1,100) pd.DataFrame (Data = [L]) Out [11]: 0 1 2 3 4 5 6 7 8 9 ... 89 90 91 92 93 93 94 95 96 0 1 2 3 4 5 6 7 8 9 10 ... 90 91 92 93 94 95 96 97 97 98 98 99 [1 row x 99 column]  

    You can use the DataFrame For constructors, the column names can be passed as ARGs or can be assigned directly:

    pd.DataFrame (data = [L], column = call_list) < / P>

    or

      df.columns = col_list  

    How to change SQL Server Analysis Service Log-On account from Any Specific user account to inbuilt account i.e. NT Service \SQLServerOLAP? -


    I changed the SQL Server Analysis Services account to the account created with my system user account. I want to use the previous NT service \ SQLSerVER OLAP (do not remember the correct name, but anything like this).

    I did not find any useful suggestions, how can I get that account?

    Please help.

    Configure service accounts (Analysis Services)

    About permissions in There are all the details that you will need to revive.


    php - Applying twig filters in Drupal 8 Views Template -


    I am using a theme view in Drupal 8 that uses the trigger. I would like to use the Tribune filter on the row.content variable in the View-View-unformatted.html.twig template.

    It seems that row.content is an array, so the string of the twig does not manipulate the job. However, it prints on the page as a string (see only the list of classification conditions).

    What I want to do is to mess out the output, so the classification words with spaces may contain valid href, change the filter in the code below.

      & lt; Ul class = "nav nav-tabs" role = "tablist" & gt; For {% rows in rows%} & lt; Li role = "presentation" class = "{{loop.first? 'Active': ''}}" & gt; "{{Row.content}}" role = "tab" data-toggle = "tab" & gt; {{Row.content}} & lt; / A & gt; & Lt; / Li & gt; {% Endfor%} & lt; / Ul & gt;  

    This only outputs and . Does anyone know how to use Raw text value of production during Tweezes interpolation?

    Thank you!

    I ran into it on myself because it was difficult because the crashes on beams and dump scenes. Although there is a quick solution to get bits, enter it under the {% in rows in rows} in your trigger view style template.

      & lt; Ol & gt; Key for {%, line in concert%} 
  • gt; {{Key}} & lt; / Li & gt; {% Endfor%} & lt; / Ol & gt;
  • Load with that page & amp; You get a key to see, I checked each with the following dump command, just added below the test.

    The above dump showed all the stuff in #ro, where I Dug and got the field that I wanted (can be different for you), then I wanted to replace the empty space with the dash. Lowercase the lowercase

    Everything past row.content ['# Line'] is probably different for you, you have to dig into a small array with the order of the above given dump. The below is the line I got.

      {{row.content ['# row'] ._ entity.title [0] .value | Replace ('', '-') | Less}}  

    Below is an example of a toggle template. Change the file name change to the name of the view and block-3 in your setup.

    View-view-unchanged - View-name - Block-3 Html.twig

    {% line in line%} {% set} Row_classes = [default_row_class? '{{Row.content [' # row '].' Entity quote '[0] ; & Lt; Section {{row.attributes.addClass (row_classes)}} id = "{{row.content ['# row'] ._ entity.title [0] .value | replace ('', '-') | less} } "& Gt; {{Row.content}} & lt; / Section & gt; {% Endfor%}

    I'm sure there are so many other ways to do this, but it works as a quick solution for me to print the visual field in the style template. That's really useful.


    c# - Building a Raw SQL String from Linq Query Results? -


    I have to make a selection from a SQL Server table and add the results to a SQL string so that I var sqlString = "Select Blama by Blah Blah from Black" :

    Enter image details here

    Here's my LINQ. I am trying to select the columns for which I need them & amp; Align them to 1 string:

      var query = (_Context.tbArticleTypeAssets where a.ArticleType == Select articleType new {sqlQuery = a.ColSelection + "+ + a.FromTable + "" + .whereclause + "" + a.orderBY}); String queryRezalt = query.ToString ();  

    The result is a Linq output that I do not want. I just want the values ​​of stars. Is there any way to get it?

    The linux query will return an archive, you must first () or First and default () to get the item:

      string query sage = query.FirstOrDefault (). SqlQuery;  

    Better is also a null check:

      string query result = query.FirstOrDefault ()! = Null? Query.FirstOrDefault (). SqlQuery: string.Empty;  

    php decode JSON -> mysql query -


    I am trying to create a query I do not know why this php does not work.

    There is no change in my DB.

    What are the errors?

      & lt;? $ Json = file_get_contents ('php: // input'); $ Obj = json_decode ($ json); $ Con = mysql_connect ("localhost: (port)", "id", "pw") or die (can not be connected to 'db); Mysql_select_db ("DBID", $ thief); $ Line = $ obj- & gt; {"Menusel_row"}; $ Col = $ obj- & gt; {"Menusel_col"}; $ Val = $ obj- & gt; {"Menuvalue"}; Mysql_query ("UPDATE SET $ row = '$ val', where id = '$ col'", $ con); Mysql_close ($ thief); ? & Gt;  

    A brief note: You can use PHP & lt; ? , this feature is most disabled on your PHP server because it is obsolete

    The absence of any output is probably related to it. Instead & lt ;? Use Php .


    Java Class Library and JVM -


    I'm a bit confused about JVM architecture. Can we say that Java Class Libraries JCL Java virtual machine JVM ?

    Java virtual machine is an abstract computing machine ... [Joe] Java programming language Do not know anything about

    JCL is required to implement Java language.

    So you can use JVM to implement any of your selections and you can run Java program on any suitable architecture. For example, Android can run programs written in Java on Android Runtime (ART).


    linux - Environmental/global variables are not expanded in shell script -


    I am trying to execute a function via SSH. I am able to do this after following.

    But if I have some global / environmental variables in the shell script, then it is not expanded. Here the source code for the SSH node is not an option like a local copy.

    Ex: I tried:

      #! / Bin / bash ss = "TYPO" fun 2 () {arg = $ 1 ebb $ arg & gt; /tmp/a.oecho $ sKS & gt; & Gt; /tmp/a.o} Have fun 1 () {echo "SKKsKSKs" & gt; /tmp/a.o fun2 "SPSP"} fun1 SSH = "ssh -4q -o Hardhawk Checking = No-O Connect Timeout = 10" $ ssh < SH-host & gt; When I executed this script on the local node, I gave it the output:  
      cat / tmp /   AO SKKKSKKS SPSXKS SAPP typo  

    but on SSH node:

      SKKsKex SSPS  

    here $ SKS is not expanded on the SSHed node has been done.

    Please help me solve it.

    Regards, Sridhar

    You can call local $ SKS Expanding the variable typeset -f functions that are not installed or exported on the remote side so that you can get functions on the remote side, but not the variable.

    If you want to distribute the variable available to the remote, you either have remote-executed shell scripts or pre-expansions that in any way function on the local side.


    java - NumberFormatException on Integer input after previous Long input -


    itemprop = "text">

    I get a NumberFormatException when I get a call for integer input after

    class < After making a call for the first long input, here is my code snippet

      System.out.print ("Student ID:"); StudentID = sc.nextLong (); System.out.print ("Student Number:"); StudName = integer Paracetrain (s. Nxtine ());  

    Followed as error output

      There are exceptions in the thread "main" java.lang.NumberFormatException: for input string: "" student name : Java in .lang.NumberFormatException.forInputString at java.lang.Integer.parseInt (Integer.javaitter92) (NumberFormatException.java:65) java.lang.Integer.parseInt (Integer.java:615) student.StudentClient.main On (StudentClient.java:68) Java Results:? 1  

    I can understand how I can solve this error


    I use sc.nextInt () Instead, at the beginning of my code:

      System.out.println ("\ nMENU 1-QUIT / 2-ADD Student"); Option = option = sc.nextInt (); If (option == 1) {System.exit (0); } If (option == 2) {studentIndex ++; Student list [studentIndex] = new student (); System.out.print ("Student Title (Mr. / Mrs.):"); StudentTitle = sc.nextLine (); System.out.print ("Student First Name:"); First name = sc.nextLine ();  

    Output 1x input is omitted from the above code. Who makes it:

      Student Title: Student First Name:  

    Your problem is that the next length () reads the next long number of calls, but not the new line after that. Therefore, when you call the next line, you get the blank line back from the end of the number, as long as you read up to the new line. For example, if I do this:

      System.out.println ("'+ sc.nextLong () +"' '); System.out.println ("'" + Sc.nextLine () + "''); Enter the numbers like System.out.println ("'" + sc.nextLine () + "' ');  

    ... and 42 and 63; I will be printed:


    php - Javascript how to parse JSON with json array -



    php - Javascript how to parse JSON with json array -

    i want parse using jquery or javascript json generated php code follows:

    json

    { "user": { "name": "john carter", "position": 0, "tickets": { "months": [ "october", "november" ], "start_time": "2014-10-02", "end_time": "2014-11-21", "open": [ "1", "3" ] } } }

    my javascript

    $.ajax({ url: 'ajax.report.php', type: 'post', data: 'start='+startdate+'&&end='+enddate, success: function(response){ var json_obj = $.parsejson(response); for(var =0; < json_obj.user.length; i++){ //what next? } } });

    kindly help. give thanks !

    the json returned jquery javascript object, not string. not have parse farther utilize it. i'm on mobile device right can't confirm, i'm pretty sure can this:

    success: function(response){ //try var name = response.user.name //try var name = response.name }

    you should able print out name string using console.log() after this.

    javascript php jquery json

    numpy - Python 3.3 import matplotlib in Windows don't get along -



    numpy - Python 3.3 import matplotlib in Windows don't get along -

    well have python 3.3 , need matplotlib function properly.

    i used pip install matplotlib install it.

    have installed six, dateutils, scipy, numpy , pyparsing work.

    but when import function "import matplotlib mpl" brings me next error:

    traceback (most recent phone call last): file "<pyshell#1>", line 1, in <module> import matplotlib file "c:\python33\lib\site-packages\matplotlib\__init__.py", line 179, in <module> matplotlib.cbook import is_string_like file "c:\python33\lib\site-packages\matplotlib\cbook.py", line 2298, in <module> _putmask = np.putmask attributeerror: 'module' object has no attribute 'putmask'

    so how prepare this?

    part of code:

    import numpy np import tkinter tk import matplotlib mpl matplotlib.patches import rectangle matplotlib.backends.backend_tkagg import figurecanvastkagg, navigationtoolbar2tkagg # custom toolbar lorem ipsum text class customtoolbar(navigationtoolbar2tkagg): def __init__(self,canvas_,parent_): self.toolitems = ( ('home', 'lorem ipsum dolor sit down amet', 'home', 'home'), ('back', 'consectetuer adipiscing elit', 'back', 'back'), ('forward', 'sed diam nonummy nibh euismod', 'forward', 'forward'), (none, none, none, none), ('pan', 'tincidunt ut laoreet', 'move', 'pan'), ('zoom', 'dolore magna aliquam', 'zoom_to_rect', 'zoom'), (none, none, none, none), ('subplots', 'putamus parum claram', 'subplots', 'configure_subplots'), ('save', 'sollemnes in futurum', 'filesave', 'save_figure'), ) navigationtoolbar2tkagg.__init__(self,canvas_,parent_)

    could please help?

    python numpy matplotlib

    r - Julia: show body of function (to find lost code) -



    r - Julia: show body of function (to find lost code) -

    in r-language able declare function , see body of function so:

    > megafoobar = function(x){ return(x + 10000 )} > body(megafoobar) { return(x + 10000) }

    is possible in julia? wrote function useful , still in memory/callable forgot how wrote it. hoping such method exists in julia can find out how wrote it.

    for functions defined in package, can utilize less or @less. former, takes function name (and returns first definition, need not 1 want), latter, function call.

    less(less) # first definition of less, # signature (string,integer) @less less(less) # definition of less(f::callable)

    but not work functions defined in repl. those, can utilize code_typed, returns ast (abstract syntax tree) of code, less readable. need provide type of arguments, because there can several functions same name: can them methods.

    f(x::number) = x + 1 f(x::abstractarray) = length(x) methods(f) # 2 methods generic function "f": # f(x::number) @ none:1 # f(x::abstractarray{t,n}) @ none:1 code_typed(f,(number,)) # give argument types tuple # 1-element array{any,1}: # :($(expr(:lambda, {:x}, {{},{{:x,number,0}},{}}, :(begin # none, line 1: # homecoming x::number + 1 # end))))

    r function julia-lang

    javascript - Ending WebRTC video call between two peers -



    javascript - Ending WebRTC video call between two peers -

    i've set video chat between 2 peers using webrtc. allow peer end chat , other peer know chat ended. 1 time chat ends, code needs executed both peers. peerconnection object has removestream() method should trigger onremovestream() listener. perfect utilize case, however, before onremovestream() called there needs re-negotiation (offer/answer) between peers. case seems odd. why re-negotiate disconnect? shouldn't peerconnection object realize no stream coming other user? my question: how can end peerconnection , alert other user?

    you can close connection. other peer can hear signal oniceconnectionstatechange , state of disconnected means peer has closed connection/is no longer available. if you, timeout before closing state because of flaky network connection. mdn has info

    or, maintain track of connections signalling server , signal peers when leaves. either way should work.

    javascript google-chrome firefox webrtc p2p

    javascript - jQuery - Color table rows when checkbox is checked and remove when not -



    javascript - jQuery - Color table rows when checkbox is checked and remove when not -

    i'm little stuck, can't head around problem. have setup jquery identifies values in radio inputs, align values within table. start doing filtering on table.

    i want next 3 things happen:

    whenever click on filter , cell has same value, it's row gets highlighted whenever check alternative off, gets removed if page loads , alternative checked, row gets highlighted on load

    jquery code:

    $(function () { // on alter of radio buttons $('input').on('change', function () { var filter = $('input:checkbox[name=filter]:checked').val(); // edit rows $(".gamestatus").filter(function () { homecoming $(this).text() == filter; }).parent('tr').addclass('filtered'); }); });

    jsfiddle: http://jsfiddle.net/darcyvoutt/8xgd51mg/

    $(function () { var filters = []; var edit_rows = function () { filters = []; $('input:checkbox[name=filter]:checked').each(function () { filters.push(this.value); }); // edit rows $(".gamestatus").each(function () { $(this).parent('tr') .toggleclass('filtered', filters.indexof($(this).text()) > -1 ); }); } edit_rows(); // on alter of radio buttons $('input').on('change', edit_rows); });

    jsfiddle

    edit: added functionality gets invoked on page load

    javascript jquery html css

    arrays - C++ segmentation fault pointers -



    arrays - C++ segmentation fault pointers -

    a programme writing takes array of names , ages , alphabetizes them. programme work. of time segmentation fault halfway through printing alphabetized list.

    this sample header file

    public: static const int maxstu = 50; student(); void inputdata(); void sortdata(); void printoriginaldata(); void printalphadata(); private: int arraytotal; int *temp1; std::string *temp2; std::string originalname[maxstu]; std::string *alphaname[maxstu]; int originalage[maxstu]; int *alphaage[maxstu];

    these functions causing issues.

    void student::sortdata() { for(int i=0;i < arraytotal;i++) { if (originalname[i] > originalname[i+1] ) { temp1 = alphaage[i]; alphaage[i] = alphaage[i + 1]; alphaage[i + 1] = temp1; temp2 = alphaname[i]; alphaname[i] = alphaname[i + 1]; alphaname[i+1]= temp2; } } } void student::printalphadata() { cout << "\nalphabetized list\n"; cout << "---------------------------\n"; (int = 0; < arraytotal; ++i) { cout << left << setw(30) << *alphaname[i]; cout << right << setw(10) << *alphaage[i] << endl; } cout << endl; }

    any help figuring out issue appreciated. there improve way sort array alphabetical order?

    c++ arrays pointers

    javascript - How to insert html content to a particular div element during ajax call success function? -



    javascript - How to insert html content to a particular div element during ajax call success function? -

    using ajax script below, want insert html content 1 of div element within table. can see have main div element called "ajaxcom" want insert html content div element class = "divrep". how insert html info in "divrep" element during success function of ajax call?

    ajax script:

    $('#ajaxcom').on('click ', '.postrep', function () { var inputs = $(this).closest('div').find('input'); //finding inputs within div var textin = $(this).closest('div').find('textarea'); //finding textarea within div var dataobject = { id: inputs.first().val(), //getting value of first input name: $(this).closest('div').find('input[class="name"]').val(), //getting/finding value of element within div reply: textin.first().val() //getting value of first textarea in div }; $.ajax({ url: '/ajaxcomms/ajaxreplies', type: "post", data: dataobject, datatype: "json", success: function (result) { $.ajax({ url: '/ajaxcomms/displayreppartial', type: "get", contenttype: 'application/html; charset=utf-8', data: dataobject, datatype: "html", success: function (result) { // $('#ajaxcom').html(result); // on part, i'm struggling???? var findiv = $(this).closest('table').find('div[class="divrep"]'); // $('.divrep').html(result); // var findiv = $(this).closest('table').find('div[class="divrep"]'); // $(findiv).html(result); findiv.html(result); } }) }, error: function (result) { alert(status); } }); }); /**hint part of ajax call:**/ $.ajax({ url: '/ajaxcomms/displayreppartial', type: "get", contenttype: 'application/html; charset=utf-8', data: dataobject, datatype: "html", success: function (result) { // $('#ajaxcom').html(result); // on part, i'm struggling???? var findiv = $(this).closest('table').find('div[class="divrep"]'); // $('.divrep').html(result); // var findiv = $(this).closest('table').find('div[class="divrep"]'); // $(findiv).html(result); findiv.html(result); } })

    html view:

    <div id="ajaxcom"> <table id="mytable">@foreach (var item in model.comments) { <tr> <td> <div style="font-weight:bold;">@html.displayfor(modelitem => item.name)</div> <p class="comment more" style="white-space: pre-line; margin-top:0px;margin-bottom:0px; border-radius: 4px 4px 4px 4px; max-width :500px; min-height :5px; display :block; background-color: #ccccff">@html.displayfor(modelitem => item.comment)</p> <p style="height:5px;margin-top:0px;margin-bottom:5px"> <input type="button" id="like" name="like" value="like" style="font-weight:normal;margin-top:0px; color:blue;border:0px;background-color:inherit;cursor:pointer" /> <input type="button" class="reply" name="reply" value="replie(s)" style="margin-bottom:10px;font-weight:normal;margin-top:0px; color:blue;border:0px;background-color:inherit;cursor:pointer" /> </p> <div id="divreply" class="divrep" style=" position:relative;left:57px; overflow:auto;margin-top:0px;margin-bottom:0px"> <table>@foreach (var item2 in model.replies.where(r => r.id == item.id) ) { <tr> <td> <div style="font-weight:bold;">@html.displayfor(modelitem => item2.name)</div> <p class="comment more" style="margin-top:0px;margin-bottom:0px;white-space:pre-line; border-radius: 4px 4px 4px 4px; max-width :445px; min-height :5px; display :block; background-color: #ccccff;">@html.displayfor(modelitem => item2.reply)</p> </td> </tr>}</table> <div> <div class="editor-field" style="display:none; margin-bottom:5px;margin-top:5px"> <input type="text" id="comidvalue" name="id" class="id" value="@html.displayfor(modelitem => item.id)" /> </div> <br /> <input type="text" id="namerep" name="name" class="name" style="width:445px;resize:none" /> <br /> <textarea id="reply" name="reply" class="reply" style="width:445px;height:100px;resize:none"></textarea> <br /> <input type="button" class="postrep" value="post reply" name="butname" style="cursor:pointer" /> </div> </div> <br /> </td> </tr>}</table> </div>

    this object within ajax success function refers jqxhr object of ajax call, not element event handler bound . utilize next

    $('#ajaxcom .postrep').closest('table').find('div.divrep').html(result);

    or set var $this = $(this); @ starting of event handler , utilize $this instead of $(this) within ajax success callback function.

    $('#ajaxcom').on('click ', '.postrep', function () { var $this = $(this); //...^........................ ...................... ...................... $.ajax({ url: '/ajaxcomms/ajaxreplies', type: "post", data: dataobject, datatype: "json", success: function (result) { $.ajax({ url: '/ajaxcomms/displayreppartial', type: "get", contenttype: 'application/html; charset=utf-8', data: dataobject, datatype: "html", success: function (result) { var findiv = $this.closest('table').find('div.divrep'); //............^................... findiv.html(result); } }) }, .................... .................... }); });

    javascript jquery ajax asp.net-mvc-3 asp.net-mvc-4

    asp.net mvc - Accessing a Virtual Directory from a Web API -



    asp.net mvc - Accessing a Virtual Directory from a Web API -

    i have folder of files (form templates) need accessed both .net web api application , separate .net mvc application. folder these form templates outside of websites. ideally, i'd able store path in web.config files applications can tested in local environment.

    i tried setting virtual directories on hosted site couldn't figure out how reference them in web api. tried several means of referencing virtual directory did not work. posts suggested trying server.mappath("myvirtualdirectory") returns "....\wwwroot\myapicontroller\action\myvirtualdirectory", not physical path of virtual directory.

    i removed virtual directory , attempted "navigate" right path blocked "cannot utilize leading .. exit above top directory".

    so right way access resource using virtual directory in .net web api application? same method going work .net mvc application?

    you need utilize hostingenvironment, like:

    public static string mappath(string path){ string result; result = hostingenvironment.mappath(path); homecoming result; }

    additionally hostingenvironment provides features applicationphysicalpath:

    result = hostingenvironment.applicationphysicalpath + "app_data\\somefile.xml";

    asp.net-mvc iis asp.net-web-api

    c# - Storing Excel Rows in List for later insertion into different workbook -



    c# - Storing Excel Rows in List<Range> for later insertion into different workbook -

    i splitting 1 big spreadsheet many (100's) smaller spreadsheet. approach store rows of source spreadsheet in list:

    list<range> ranges = new list<range>(); workbook book = xl.workbooks.add("path book"); worksheet sheet = book.sheets[1]; (int r = 1; r <= sheet.usedrange.rows.count; r++) { ranges.add((range)sheet.rows[r]); } book.close(); ...... workbook book2 = xl.workbooks.add(); worksheet sheet2 = book2.sheets[1]; (int r2 = 0; r2 <= ranges.count; r2++) { range row = (range)ranges[r2]; // sheet2.rows[r2+1].value2 = row; //fails; //querying in debug, properties of row throw exception //queryying sheet.rows[r2+1] expands expected }

    if see error please advise.

    thanks.

    i think after close first source book, can no longer utilize range references you've taken it. move book.close() end of snippet. upper bound for sec loop should < not <=.

    for (int r2 = 0; r2 < ranges.count; r2++) { ranges[r2].copy(); sheet2.paste(sheet2.rows[r2+1]); }

    c# excel interop

    java - security util using SecurityContextHolder in spring application -



    java - security util using SecurityContextHolder in spring application -

    in spring application have aspects controller methods security checks. beacause of need several checks more wrapped them static helper methods of "sercurityutil" class.:

    public abstract class securityutils { public static authentication getcurrentauthentication(){ homecoming securitycontextholder.getcontext().getauthentication(); } public static chroniosuser getauthenticateduser(){ homecoming (chroniosuser) getcurrentauthentication().getprincipal(); } public static boolean authenticationhasrole(authentication authentication, role role){ simplegrantedauthority grantedauthority = new simplegrantedauthority(role.getroleidentifier()); homecoming authentication.getauthorities().contains(grantedauthority); } public static boolean authenticateduserisadmin(){ authentication authentication = getcurrentauthentication(); homecoming authenticationhasrole(authentication, admin); } ... }

    is valid , approach? or shut wrap these helper functions spring service?

    thank you.

    ps: know can utilize @preauthorize ... aspects more complex.

    the short reply :

    yes seems valid , approach.

    the long reply :

    it's you.

    spring security documentation states infrastructure based exclusively on standard servlet filters , has no strong links particuler web technology, including spring mvc

    spring security’s web infrastructure based exclusively on standard servlet filters. doesn’t utilize servlets or other servlet-based frameworks (such spring mvc) internally, has no strong links particular web technology. deals in httpservletrequest s , httpservletresponse s , doesn’t care whether requests come browser, web service client, httpinvoker or ajax application

    [spring security reference - 1. security filter chain]

    its utilize based exclusively on securitycontextholder. examples provided through static methods :

    object principal = securitycontextholder.getcontext().getauthentication().getprincipal();

    as can see, it's not spring bean/service/component. securitycontextholder looks utility class.

    now can create spring service expose or can utilize through classic util class depending on more practical , application.

    java spring spring-mvc spring-security

    node.js - how to get the value from mongodb using node js -



    node.js - how to get the value from mongodb using node js -

    a.remove({"name":'sonu'},function(e,o){}); a.insert({"name":username,"title":username,"age":'25'},function(e,o){});

    }); need obtain these values

    a.findone({name: username}, function (e, o) {})

    node.js mongodb

    objective c - Sorting contacts based on recently used/most used/urgency in AddressBook iOS -



    objective c - Sorting contacts based on recently used/most used/urgency in AddressBook iOS -

    i need sort contacts in user's device based on used/most used/urgency , display them in single view(not in phone app these displayed in separate tabs). have researched got know sorting contacts alphabetically. addressbook framework allow or there other way around? help appreciated.

    no. unfortunately, there no way of knowing if record has been used or not.

    however, can sort records in address book using properties specified below:

    here simple illustration of sorting records based on creation date in descending order.

    abaddressbookref addressbookref = abaddressbookcreatewithoptions(nil, null); abaddressbookrequestaccesswithcompletion(addressbookref, ^(bool granted, cferrorref error) { nsarray *allpeople = cfbridgingrelease(abaddressbookcopyarrayofallpeople(addressbookref)); nsarray *sortedpeople = [allpeople sortedarrayusingcomparator:^nscomparisonresult(id arecord, id otherrecord) { abrecordref arecordref = (__bridge abrecordref)arecord; abrecordref otherrecordref = (__bridge abrecordref)otherrecord; nsdate *arecordcreationdate = cfbridgingrelease(abrecordcopyvalue(arecordref, kabpersoncreationdateproperty)); nsdate *otherrecordcreationdate = cfbridgingrelease(abrecordcopyvalue(otherrecordref, kabpersoncreationdateproperty)); homecoming [arecordcreationdate compare:otherrecordcreationdate]; }]; }); cfrelease(addressbookref);

    ios objective-c xcode sorting abaddressbook

    javascript - Initiating Jquery makes Safari Crash -



    javascript - Initiating Jquery makes Safari Crash -

    my website working great in chrome, ff & ie noticed slider doesnt show on ipad or iphone , totally freezes/crashes on safari (windows 8). have managed work out next bit of jquery in footer causing issue, can't see how or why. know causing issue because when comment out - site doesnt crash safari. can see why might happening. doing wrong?

    <script> $(document).ready(function(){ $('.mentioncontent a').attr ('target', '_blank'); $('.flexslider1').flexslider({ animation: "slide", animationloop: false }); $('.flexslider2').flexslider({ animation: "slide", animationloop: false }); $('.flexslider3').flexslider({ animation: "slide", animationloop: false }); $('.fancybox-media').fancybox({ onclose: function() { jwplayer('my-video').stop(); } }); }); </script>

    javascript jquery safari flexslider

    ASP.NET MVC - Save Generated HTML as PDF to folder -



    ASP.NET MVC - Save Generated HTML as PDF to folder -

    i've generated html page in mvc asp.net c#. (with html helpers)

    i automaticly save page pdf in specific folder

    currently, when submits form gets send db, want [httppost] turn submitted form pdf

    example: http://example1234.com/persons/details/15

    how save pdf?

    private string datadir = null; private string wkhtmltopdf = null; [httppost] [validateantiforgerytoken] public actionresult create(person person) { datadir = configurationmanager.appsettings["datadir"]; wkhtmltopdf = configurationmanager.appsettings["wkhtmltopdf"]; if (modelstate.isvalid) { db.people.add(person); db.savechanges(); //here pdf should created system.io.file.writealltext("details/" + person.id +".html")); var pdf1 = new processstartinfo(wkhtmltopdf); pdf1.createnowindow = true; pdf1.useshellexecute = false; pdf1.workingdirectory = datadir + "tmp\\"; pdf1.arguments = "-q -n --disable-smart-shrinking pdf." + person.id + ".html pdf." + person.id + ".pdf"; using (var process = process.start(pdf1)) { process.waitforexit(99999); debug.writeline(process.exitcode); } homecoming view(person); }

    posted reply 1 of other questons, applies here here go interested.

    [httppost] [validateantiforgerytoken] public actionresult create(person person) datadir = configurationmanager.appsettings["datadir"]; //datadirectory defined in web.config //also possible hardcode here, example: "c:/windows/pdffolder" wkhtmltopdf = configurationmanager.appsettings["wkhtmltopdf"]; //directory file "wkhtmltopdf", downloaded somewhere //just above, defined @ web.config possible hardcode in viewdata["ismodelvalid"] = modelstate.isvalid ? "true" : "false"; //valid checker if (modelstate.isvalid) //check if valid { db.people.add(person); //add db db.savechanges(); var filecontents1 = system.io.file.readalltext(datadir + "template.html"); //get template datadirectory filecontents1 = filecontents1.replace("#name#", person.name); //replace '#name#' name database table person.name system.io.file.writealltext(datadir + "tmp\\template." + person.id + ".html", filecontents1); //create new html page replaced text //name of file equals id of person var pdf1 = new processstartinfo(wkhtmltopdf); //start process wkhtmltopdf pdf1.createnowindow = true; //don't create window pdf1.useshellexecute = false; //don't utilize shell pdf1.workingdirectory = datadir + "tmp\\"; //where create pdf pdf1.arguments = "-q -n --disable-smart-shrinking overeenkomst." + person.id + ".html overeenkomst." + person.id + ".pdf"; //get html convert , create pdf same name in same directory } homecoming view(person); }

    html asp.net-mvc pdf visual-studio-2013

    angular ng if - AngularJs ng-if comparing dates -



    angular ng if - AngularJs ng-if comparing dates -

    i looking compare 2 dates in ng-if jade file looks like.

    li.list-group-item(ng-if="app.segments[0].startdate.gettime() > date.gettime()") div.row div.col-xs-12 span i.fa.fa-plus-square

    this code add together li ui if startdate of first segment after today.

    $scope.date = new date(); $scope.app = { segments: [{ startdate: 2014-11-15t04:00:00.000z enddate: 2014-11-20t04:00:00.000z }, { startdate: 2014-11-21t04:00:00.000z enddate: 2014-11-25t04:00:00.000z }] }

    is there anyway create work?

    if they're date object compare them straight without .gettime()

    $scope.date2005 = new date('2005/01/01'); $scope.date2006 = new date('2006-01-01t04:00:00.000z'); <div ng-if="date2005 > date2006">date2005 > date2006</div> <!-- won't show --> <div ng-if="date2006 > date2005">date2006 > date2005</div> <!-- show -->

    http://plnkr.co/edit/fnb11u6kmfszdv3lmapj?p=preview

    angularjs angular-ng-if

    How do you set the maximum recursion depth in R? -



    How do you set the maximum recursion depth in R? -

    i running r code has recursion depth of 5000 , next error:

    error: evaluation nested deeply: infinite recursion / options(expressions=)? error during wrapup: evaluation nested deeply: infinite recursion / options(expressions=)?

    how set recursion depth in r?

    ah. found reading error message. set recursion depth 100000

    > options(expressions= 100000)

    r recursion

    ssrs 2008 - How to preserve header rows using a Matrix -



    ssrs 2008 - How to preserve header rows using a Matrix -

    how preserve header rows using matrix , don't mean preserve them @ page level.

    what happens. when click plus/minus on row row info replaced next groups data.

    so .. myrow-45-60-04

    after click on row .. myrow-secondrow-15-30-100

    as can see upon opening main row info replaced "secondrow" on same line.

    i need drop downwards , show both rows plus kid row. needs work rows beneath parent row.

    myrow-45-60-04 secondrow-15-30-100 thidrow-85-74-5 fourthrow-64-39-9

    i worked out solution based on microsoft ssrs page.

    right click on grouping cell of row , create row above, within group. should move cell , contents 1 row. each row grouping clicking in box of row name. should see row/column step each row group.

    firstgroup sec grouping thirdgroup

    as can see separate on screen stepped. grab look secondgroup , move 1 cell backward. align under firstgroup. same thirdgroup.

    you should have this

    firstgroup secondgroup thirdgroup

    looks on top of each other. adjust padding each group. looks pretty tens. default 2 add together 1 first 1 making 12. increment rest see fit.

    the next issue column total still stuck on bottom row due fact created rows above it. prepare copying look cells above it. not remove lower expression. need 1 each row.

    last step delete empty columns right of moved cells. create sure not delete cells expressions in them. in illustration deleting 2 empty columns

    your table should this.

    firstgroup | <exp> | <totals> secondgroup | <exp> | <totals> thirdgroup | <exp> | <totals>

    this illustration solves 2 issues @ once. keeps grouping level info in tact when expanded , give matrix clean look.

    matrix ssrs-2008

    postal code - Regex to match the first half of a UK postcode -



    postal code - Regex to match the first half of a UK postcode -

    i need regex match first half of uk postcode, , it's possible 1 half or total post code passed in.

    there great way match total postcode here: uk postcode regex (comprehensive)

    however need first 3 or 4 characters of postcode, possibility of half post code or postcode without spaces getting passed in, of these:

    sl4 4bz sl44bz - pull out 'sl4' sl4 dy10 dy10 3bd dy10 3bd

    the regex needs match:

    if it's 5 characters long (excluding spaces), remove lastly 3 characters , first 2 remaining characters half-a-postcode if it's 6 characters long (excluding spaces), remove lastly 3 characters , first 3 remaining characters half-a-postcode if it's 7 characters long (excluding spaces), remove lastly 3 characters , first 4 remaining characters half-a-postcode if it's 2, 3 or 4 characters long, maintain it

    but can't quite head around how write complex.

    updated 2/5 characters well, total coverage = 2/5 or 3/6 or 4/7

    this works input samples. here 2 variations of same thing.

    results in capture grouping 1

    # (?m)^([a-z0-9]{2,4})(?:\s*[a-z0-9]{3})?$ (?m) ^ ( # (1 start) [a-z0-9]{2,4} ) # (1 end) (?: \s* [a-z0-9]{3} )? $

    results in capture grouping 0

    # (?m)^[a-z0-9]{2,4}(?=(?:\s*[a-z0-9]{3})?$) (?m) ^ [a-z0-9]{2,4} (?= (?: \s* [a-z0-9]{3} )? $ )

    @smickie - update - regarding question inline-modifiers in js. (i'm not js expert here simple example) don't believe inline modifiers build available. however, can added via flags parameter (enum) or in /../flags notation.

    you can see illustration work in jsfiddle here --> http://jsfiddle.net/cdcv8uug/

    var teststr = "sl\nsl 4bz\nsl4bz\nsl4\nsl4 4bz\nsl44bz\ndy10\ndy10 3bd\ndy10 3bd"; var arr = teststr.match( /^[a-z0-9]{2,4}(?=(?:\s*[a-z0-9]{3})?$)/mg ); var res = "using match() -> capture grouping 0\nteststr.match(/^[a-z0-9]{2,4}(?=(?:\s*[a-z0-9]{3})?$)/mg)\n"; (var index = 0; index < arr.length; index++) { res += index + ": " + arr[index] + "\n"; } var re = /^([a-z0-9]{2,4})(?:\s*[a-z0-9]{3})?$/mg; res += "\nusing exec() -> capture grouping 1\nvar re = /^([a-z0-9]{2,4})(?:\s*[a-z0-9]{3})?$/mg;\nre.exec(teststr)\n"; index = 0; while ((arr = re.exec(teststr)) != null) { res += index + ": " + arr[1] + "\n"; index++; } alert( res );

    regex postal-code

    linux - Make Jenkins metadata available for projects -



    linux - Make Jenkins metadata available for projects -

    i've set jenkins server + metadata plugin (https://wiki.jenkins-ci.org/display/jenkins/metadata+plugin).

    i'm having problem understanding how metadata can used in projects. i've added keys default values (e.g. some_metadata_key, default value foo string) using jenkins -> metadataconfiguration page. expose environment checked.

    now, if create new project, in "meta data" section can see some_metadata_key preset value.

    how can utilize ? want end in build environment; running shell script env doesn't show variable.

    in project, i've tried:

    created new string value same name predefined variable, no value set (i hoping predefined value default) --> fail, variable not set @ all.

    create new string value different name (i.e. some_foobar_key) , value of $some_metadata_key --> fail, variable has value of "$some_metadata_key" instead of foo

    my goal able define "global" values in single place , have them available multiple projects evironment variables.

    metadata weird. if you're expecting utilize global environment variable, it's not going behave way want.

    from metadata plugin page:

    we differentiate between metadatadefinitions , metadatavalues. thought comes parameter setup in jenkins. metadatavalue what's set on configuration page of project or slave , saved build.

    metadatadefinitions used admins making sure metadata exist on projects. metadatadefinition set through special configuration page, configuring name , default value definition. 1 time set, metadatadefinition end in projects on server, prompting user set value when project configured. metadatadefinitions converted metadatavalues.

    as understand it, have metadata definition (from global metadata configuration) , need alter metadata value it's available in project.

    the rules how definitions converted values not explained. in experience, editing project's configuration , selecting or editing specific preset value seems import definition project value. so, if follow these steps, can see metadata in project's build environment:

    define key (my_key) , value in global metadata configuration, create sure expose environment checked. edit project's configuration. metadata key , default value should appear under presets. select or edit value of preset want "import" project. save. run build , check environment md_my_key.

    based on of this, i'd concerned trying utilize value in global definition across many projects. suspect project's value may divorced global definition value when project converts definition value. metadata documentation implies definitions making sure metadata exists on projects, not managing same values across projects.

    linux jenkins jenkins-plugins