Sunday, 15 March 2015

c# - Append Image or content to an existing PDF with PDFSharp -


Is it possible to add PDFsharp at the end of an existing PDF file?

I want to embed one or more of the following content types:

  • HTML
  • PNG (or other image format)
  • You can not add HTML directly. On NuGet, you can find "HTML renderer for PDFs using PDFSHRP" for that purpose.


osx - Can't find info.php on Mac -


I have enabled everything for Mac using the bundled PHP and other tutorials on the PHP website. When I go to it, it displays "This works", but when I'm going, I get an error message "The requested URL XXX was not found on this server". I can manually navigate to user / erics / sites / info.php and open it, but I can not find it in the browser. If someone can help me understand this, I would appreciate it.

You can view the file on your local machine like the file in your browser: /// Users / Eric / Sites / info.php, but it will give you the source code of that file. None of this will execute your code. If you want to execute your code with http: // then you have to go to your server, as the URL should be relative to your root directory, which is a local host) Example: If you have a local host directory that is named test And in that test folder you have the file named test.php, you can access it in your browser:

Does that mean?


PHP foreach statement and HTML generated links -


I have a php foreach loop which displays a list of events (organizer, event name, hour-minute, etc.). ..). One event per line such as:

  My | My Event Name | 17h45 |  

On a very similar website (but with very complexity) I found it in the source page of the exhibit:

    

So, in the creation of this event, do you think a new HTML file has occurred? How can I do this? What is good practice? Maybe I want JS?

Sorry, if my question is not very clear ...

me It does not appear that they generate a new HTML file for each event. Most likely they use just .htaccess to reuse all requests such as ".jpg-digits.html", let's say, event.php. This event.php receives the request URL or request (depending on their .htaccess instructions) and receives those digits, which are the ID of the event, and everything is received from DB.

Yes, this is generally good and helps the URL look user-friendly. You can easily make it and you can not need JS.


amazon ec2 - Can't find 'stof' and 'stoi' in this scope on EC2 instance when running C++ application? -


I'm trying to compile a C ++ application on a r3.xlarge EC2 instance I am I have installed G ++ with the command with the command yum install gcc-c ++ . However, I still is to get a bunch of error: The Scope was not declared and error: not running when declared in this scope "Stey ' Was creating . I think it has to do something with C ++ 11, but I am quite new to C ++, so I'm not quite sure how to start it. Here are my Makefile if it does not make any difference:

Makefile :

  CC = g ++ ifeq ($ (shell sw_vers 2 & gt; / dev / null | grep Mac | awk '{print $$ 2} "), Mac) CFLAGS = G -DGL_GLEXT_PROTOTYPES -I./include/ I / usr / X11 / include -DOSX LDFLAGS = -framework glut -framework Open \ l "/System/Library/Frameworks/OpenGL.framework/Libraries" \ -lGL -lGLU -lm -lstdc ++ rest CFLAGS = G -DGL_GLEXT_PROTOTYPES -Iglut-3.7.6- bin LDFLAGS = -lglut -lGLU FLAGS + = -O3 FLAGS + = -std = c ++11 FLAGS + = -D_DEBUG G-wall all-endif: Visual View: scene.o $ (cc) $ (cflgs) -o scene scene.o lodepng.o $ (LDFLAGS) scene.o: Scene.cpp $ (CC) $ (CFLAGS) -c Scene.cpp -o scene.o lodepng.o: lodepng .cpp lodepng.h $ (cc) $ (CFLAGS) -c lodepng Cpp -o lodepng.o clean: $ (rm) * .o view  

Any ideas? Thank you.


pagination - My Kaminari links are not working with Rails, unless I reload the browser -


Edit: Basically this is because I'm making a pagination in a bootstrap class - col-xs-5 So that everything appeared on the right side of the page when I commented it completely, the links worked fine but everything is now like normal non-bootstrap content ... to do this?

EDIT: Is this a browser thing? I'm on the MacBook Pro OSX Yosemite using Safari Browser Basically, if I select Page 2, then that URL is correctly displayed in the browser URL field: LocalHost: 3000 / user / Showtasksforuser? Page = 2, but the entries for page 2 are not rendered in place of Page 1, unless I reload the page 2 url manually by pressing enter2.

(As a sidenote, user / showtake for user / users / showtak for user / page = 1 is not needed for the first page).

Users / showtasksforuser.html In ARB:

  and lt;% @ tasks.each do | Work | & Gt%; & Lt; / Br & gt; & Lt; / Br & gt; & Lt; Div style = "text-align: center" & gt; & Lt;% = task.name% & gt; & Lt; / Div & gt; & Lt;% end% & gt; & Lt;% = Paginate @ Task, Remote = & gt; True% & gt;  

In my user control:

  def showtasksforuser @ task = task. Page (param [: pg]). Per line (1)  

In my work model:

  paginates_per 1  

The first line after the model manifesto is.

The problem is that you have not created a showtasksforuser.js.erb file.

  & lt; Div id = "taskList" & gt; & Lt;% = Render "task_list"%> & Lt; / Div & gt; & Lt;% = Paginate @ Task, Remote = & gt; True% & gt;  

_task_list.html. ARB

  & lt;% @ tasks.each do | Work | & Gt%; & Lt; / Br & gt; & Lt; / Br & gt; & Lt; Div style = "text-align: center" & gt; & Lt;% = task.name% & gt; & Lt; / Div & gt; & Lt;% end% & gt;   users_controller.rb   

def showtasksforuser @tasks = task.page (Param [: pg]). Reply-to (1) | Format | Format.js format.html End End

showtasksforuser.js.erb

  $ ("# taskList"). Html ('  

/ div>

html - Filters and for loops in Django -


I'm sorry if this is a clear question, I'm new to Django and Python. I am working on a small blog application The following code retrieves all the posts from my database. I do not want to display them all within the main page. I just need three of all I believe that it is done for loop and some type of filter according to the document.

views.py

  def all (request): allPosts = Post.objects.all () reference = {'Mail': allPosts } Templates = "home.html" submission of references (request, template, reference)  

Home HTML

  & lt; Div class = "sidebar-module" & gt; & Lt; H4 & gt; Archive & lt; / H4 & gt; & Lt; Ol class = "list-volatile" & gt; {% For single post to%} 
  • gt; & Lt; A href = "#" & gt; {{Single.post.title}} & lt; / A & gt; & Lt; / Li & gt; {% Endfor%} & lt; / Ol & gt; & Lt; / Div & gt;
  • You are looking for only 3 posts, so there is no need to drag everyone The entries will be enough, the following:

      def All (request): "" "Only three posts to use one piece operation." "" All posts = posts.Objects. [: 3] Reference = {'Post': All Post} Templates = "home.html" Submitting Returns (Request, Template, Context)  

    You can find more in official documents : If you need filtered results, use the same concept, but apply your filter:

    On the other hand if you are going to use them all on one post, but only one 3 different parts from the same set (a sidebar, etc.), Micro you can get them as my original post, and then loops inside templates:

      & lt; Div class = "sidebar-module" & gt; & Lt; H4 & gt; Archive & lt; / H4 & gt; & Lt; Ol class = "list-volatile" & gt; {% For single post} Slice: ": 3"%} 
  • gt; & Lt; A href = "#" & gt; {{Single.post.title}} & lt; / A & gt; & Lt; / Li & gt; {% Endfor%} & lt; / Ol & gt; & Lt; / Div & gt;
  • The above will result in a new query, though be careful, if you are facing load problems, it would be better to evaluate your query, list it Be sure to use and evaluate the query:

      DF All (Request): "" "Before evaluating this template," Billo "evaluates the query. Before doing (eg ) "All posts = list (post.objects.php) reference = {'postal': all post} template =" home.html "submission of return (request, template, reference) )  

    You can find more information about the evaluation here:


    python - Printing out subprocess when regex captures -


    मैं अजगर में बैश कमांड चला रहा हूँ:

      proc = subprocess.Popen ( सीएमडी) proc.wait ()  

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

    का उपयोग करके मेरी पहली बार ऐसा करने के बारे में निश्चित नहीं है आप पाइप को आउटपुट को सीधे grep आदि कर सकते हैं।:

      उपप्रोसेस आयात पाइप, पॉपिन पी = पॉपिन (["ps"], stdout = PIPE) p2 = popen ([" Grep "," chrome "], stdin = p.stdout, stdout = PIPE, universal_newlines = true) p.stdout.close () बाहर, err = p2.communicate () प्रिंट (आउट) 421? 00:00:03 क्रोम 767? 00:00:02 क्रोम 843? 00:00:04 क्रोम 2788? क्रोम 2819? 00:00:00 क्रोम-सैंडबॉक्स 2820? 00:28:00 क्रोम 2827? 00:00:00 क्रोम-सैंडबॉक्स  

    sql server - create dummy column in a query that its value come from a condition -


    I am creating a query that I will use it in crystal reports that the query is working fine but I I want to add another column (dummy column) which will be filled on a condition basis, the query is:

      Actcode, Actnet, Segment 0 + '-' + Segment_1 ActName, Max (Refraat) , Minimum (Refdate), Debt as Debit, TD in Deposits (TD) as Credit from Oact T .Actcode = Submit as GDT 1 T1 on T1. Account where ('Segment like' segment like '01% 'or '02%' or 'Segment like' '03% ') and (T. 0. Segment_1 =' 01 ') and (' 2014-01-31 'And' 2015-12-27 'refdate) by Actctod, Actnet, Segment_0, Segment, by order ectcode  

    If the segment starts with' 01 'then dummy The value in column will show 'A' if the segment_0 starts with '02' then the value will show 'L' in the dummy column. 'If Segment starts with 0' 03 'then dummy column will show the value' E 'if I tried to use the statement, and the case but luck was not on my side: (

    ruby - Unable to perform any action using phantomjs watirwebdriver -


    I use the phantomjs webdriver to fill a text box on a webpage, clicking on a button, such as unable to perform an action I'm Headless Execution.

      requires 'water-webdriver' b = water :: browser. New: Phatamaz Bijito "google.com" b.title # Google b.text_field (: id = & gt; "Lst-ib") set "Avinash"  

    then fills the text box Time, I'm facing the problem below.

      Watir :: Exception :: UnknownObjectException: Unable to detect element {: id = & gt; "Lst-ib",: TAG_NAME = & gt; "Input or Text Area" ,: Type = & gt; "(Any text type)"} `assert_exists' /Ruby/Gems/2.0.0/gems/watir-webdriver-0.6.10/lib/watir Library / from /Library/Ruby/Gems/2.0.0/gems -webdriver / elements / element.rb: 508: in /watir-webdriver-0.6.10/lib/watir-webdriver/user_editable.rb:11:in ` '(IRB) from: 16 / usr / bin / IRB: 12: In & lt; Main & gt; ' Set  

    The same script works fine when using Firefox without headless execution. Please tell me if there is any suggestion here.

    Below are my gem versions:
    1. Water-WebDriver (0.6.10)
    2. Selenium-WebDriver (2.45.0, 2.43.0)
    3. Phatcom 2.0.0

    itemprop = "text">

    The main problem is that it looks like HTML by Firefox PhantomJS is different from.

    The HTML of the text field in Firefox:

      & lt; input spellcheck = "false" dir = "ltr" style = "border: medium none; padding: 0px; margin: 0px; height: auto; width: 100%; background: url (& amp; quot; data: image / gif; base 64, R0lGODlhAQABAID / AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw% 3% D 3 and D amp; quot;) repeat scroll 0% 0% transparent; position: absolute; Z- index dropped 6; 0 pixels; Profile: medium none ; "aria- autocomplete =" both "role =" tell the "aria-haspopup =" false "class =" gsfi lst-df "id =" lst- IB "maxlength =" 2048 "name =" q "automatic : Full = "off" heading = "search" value = "" RIA-label = "search" type = "text" & gt;  

    In contrast, PhantomJS shows:

      & lt; Input style = "color: rgb (0, 0, 0); margin-top: 0 px; margin -Right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding- right : 8px; padding-bottom: 0px; padding-left: 6px; vertical-align: top; outline style: none; outline-width: initial; outline-color: initial; "auto-integer =" off "square =" Lst "value =" "title =" Google search "Maximum length =" 2048 "name =" q "size =" 57 "Dir =" ltr "spell check =" wrong "& gt;  

    Note that there is no ID attribute in the PhantomJS. As a result, it is understood that the detection of the field causes its ID to fail.

    You must use a different locator for example:

      b.text_field (: name = & gt; "q"). Set ("Avinash")  

    or

      b.text_field (: title = & gt; "Google search") set ("Avinash") < / Code> 

    html - CSS navigationsbar position fixed section go under -


    I have created a small page with a navigation bar and a segment I navbarbar status: fixed; , but if I do this, then under section navigation bar, this is the problem.

      * {margin: 0 px; Padding: 0 pixels; Font-family: 'Oswald', without-serif; } Body {background color: RGB (29, 29, 29); Height: 2000px; } NAV {Width: 100%; Background color: RGB (14, 14, 14); Hidden flurry; Border bottom: 2px solid black; Margin-down: 5px; Status: fixed; Top: 0; } .nav-top-ul {font-size: 0px; Width: 9 30px; Margin: 0 px auto; } .nav-top-li {display: inline-block; } .nav-top-a {display: block; Font-size: 16px; Padding: 10px 20px; Color: #C1C1C1; Infection: all 0.5 s; Text-decoration: None; } .nav-top-a: hover {color: white; }. Left {float: left; } Section {margin: 0 px auto; Width: 9 30px; Background color: orange; }  
      & lt ;! DOCTYPE html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; Seite & lt; / Title & gt; & Lt; Link href = 'http: //fonts.googleapis.com/css? Family = oswald 'rel =' stylesheet 'type =' text / css' & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; NAV & gt; & Lt; Ul class = "nav-top-ul" & gt; & Lt; Div class = "left" & gt; & Lt; Li class = "neo-top-lee" & gt; A class = "new-top-A" href = "index.php? Content = home" & gt; Namdisite site & lt; / A & gt; & Lt; / Li & gt; & Lt; / Div & gt; & Lt; / Ul & gt; & Lt; / Neo & gt; & Lt; Section & gt; Cross Matisse Archeter Purus at Emmet Fementum is a great option for free online, free online messianas, but there is also no matte. For those employees working with colleagues and working extensively, for an extra time, anne lasnia bibendem nalla cal fixtures can be used as fuse dipibs, conveyors and consultants, which That can be used for noodles. Donec sed odio dui can be used as closed porters fuse dipbs, conveyors and consultants for a period of time, which can be used for noodles. There is a great option for messens, but there is no matte that there is no matte. How to find out about Piane Cresin in the Aeon Yu Leo Kwam & Lt; / Section & gt; & Lt; / Body & gt; & Lt; / Html & gt;  


    bash - Access another partition using terminal in ubuntu -


    Whenever I try to use mounted partitions using the terminal in Ubuntu, then such a file does not come out , I cd / media / usrname / !! Using other partitions using cHoReS !! And I get an error:

      cd / media / user / cd sudo apt-update update & amp; Sudo apt-get gpartedcHoReSsudo apt-get update & amp; Amp; Sudo apt-get gpartedcHoReScd sudo apt-get update & amp; Amp; Sudo apt-get gpartedcHoReSsudo apt-get update & amp; Amp; Install Sudo apt-get gparted bash: cd: / media / usrname / cd: No such file or directory  

    Actually I have gparted installed before giving this command. But I think there is nothing to do with it because it will always rewrite what it writes in the error first.

    The history replacement of unwanted exclamation marks is to close the history expansion or quote the name of the directory ( Or rename it so you do not have it).


    hyperlink - How to config Sonar notification email? -


    Sonar sends notifications by email, which contains a link. This link is not always right when I changed the default configuration, for example:

    When I changed the port from 9000 to 8088, the email always gives the default port like this local host: 9000 ... How can I change this link? Can I create my own personalized email format?

    To correct the link, open the Settings area of ​​the web UI, and select "General" section Under, set the "server base url" value so that the link email is generated, point to the correct location. It can also be set in your sonar. Property file can be set as Sonar.CosarServe's URL

    Do not forget to restart sonar service to make the changes effective.


    How to easily transition from Haskell to Python 3 -


    So I have written some pretty elegant Haskell codes for my college homework and found out that they plan to support Haskell Not for our homework.

    I have received an email saying that I should use most of the python from "functional" since all supported languages.

    I have tried some quick codes to change the python, but it is a bit confused that in reality it is to look ugly.

    Then my hazel code is

     $ Code $ $ 5 input $   

    and my Python 3 code is

      change = list (map (lambda x: list (map (lambda y: y.split (",", x)), map ( Lambda z: z.split ("- & gt;"), written_input [5:])))  

    Since I wrote about 10 lines of dragon, I was hoping for some That I am not getting a good way of handling such things.

    The most disturbing fact of me is that sometimes I am X Split must be used and map should be map (F, X).

    Is this a better way to approach?

    I do not recommend typing the Python code in this way, because Python will list this type of thing It makes good use of understanding and other techniques, but if you really want to write it in functional style, it can do something like DTF (N, Iterated): return importer from imports from ISLICE (ITRAT, N) DEF software Import string from import string from

     

    You can tell, this is quite dirty. Another dragon solution possibly

     transition = (for a drop down (5, input) in B. a.split ('- & gt; ( This is also a case where I think regular expression is acceptable: 

     < Code> Import on DEF split (* CEPS): return partial (re-split, '|'.) (Re-Asepep (sep) transition for sep in sep = IAP (split (',', '- & gt ; '), Drop (5, input))  

    I am still using functional techniques, such as mapping, generic le / drop, partial application and understanding, but it comes out very cleaner to use more dragon features For the simplest case my favorite simple generator is understood, but the last one is very good if you want more delimiter.


    Git command line equivalent of GitHub app's magic stashing? -


    According to the GitHup app documentation, " when you switch branches, Geeth Hub [for Mac] Does anyone know about this "Magic Stashing" git command line?

    Suppose you are working on the branch current-branch basically, what happens in Git-terms:

      git stash Git checkout other-branch  

    Then, when you checkout current-branch

      pop instead of git hiding  

    stores ungraded changes in the working directory. Git hiding places to capture unlimited changes and keep them at the top of current-branch


    r - Compare two data.frame and delete rows with common charecters -


    I have two data. Frame x1 & amp; X2. I want to remove rows from x2 there is a common found genes x1 and x2

      x1 & lt, - chr started late gene 1 8401 8410 Mndal, Mnda, Ifi203, Ifi202b 2 8001 8020 Cyb5r1 , Adipor1, Klhl123 40014020 Alyref2, Itln1, CD244x2 & lt; - chr started late gene 1 8861 8868 Olfr1193 1 8405 8420 Mrgprx3-ps, Mrgpra1, Mrgpra2a, Mndal, Mrgpra2b 2 8501 8520 Chia, Chi3l3, Chi3l4 3 4321 4670 Tdpoz4, Tdpoz3, Tdpoz5 x2 & lt; - chr started late gene 1 8861 8868 Olfr1193 2 8501 8520 Chia, Chi3l3, Chi3l4 3 4321 4670 Tdpoz4, Tdpoz3, Tdpoz5  

    , Strsplit (2 x $ genes, '')) # # early end Jean # 2 2 8501 8520 Chia, Chi3l3, Chi3l4 # 3 3 4321 4670 Tdpoz4, Tdpoz3, Tdpoz5

    Or to change! == 0 with any (x% x%) length (intersection (x, y)).

    Note: If the "gene" column is "factor", then it can not take the 'factor' class as "code" in the form of "code" strsplit . I.e. strsplit (as.character (x1 $ gene ','))

    update

    Based on the new dataset for 'x2', we Can be merged into both the datasets, strsplit 'Genes.x', 'Genes.y', merge from production dataset ('xNew') into the merge 'chr' column. (X1 -; logical indices 'Genes.y' is based on the occurrence of any element of 'Genes.x' in the string, that the use of 'x2' dataset subsets

      xNew & Lt x 2 [, c (1,4)], by = 'CRR' index and lieutenant; - mappily (function (x, y) Isi also (x% of% y), Strsplit (Aksani $ Jen.aks, ','), Strsplit (xNew $ Genes.y, ',')) x2 [! Indx,] # chr started late Gene # 1 1 8861 8868 Olfr1193 # 3 2 8501 8520 Chia Chi 3L 3, Chi 3L 4 # 4 3 4321 4670 Teedeepijh 4, Teedeepijh 3, Tdpoz5  

    php - Codeception fails when popup is closed automatically -


    I have a very simple acceptance test using codeaptions and WebDriver (it's a hybridath ("login through some" * some) Social network).

    Code:

      $ i = $ i = new acceptor ($ scenario); $ I- & gt; ('Register using VK account (hybridauth) and check the list of friends loaded'); $ I- & gt; AmOnPage ('/'); $ I- & gt; See ('VKontakte'); $ I- & gt; Click ("VKontakte"); $ __ Handles = Faucet; $ I- & gt; ExecuteInSelenium (Function (\ WebDriver $ webdriver) {Global handles $ __, $ __ handles = $ webdriver- & gt; getWindowHandles (); $ webdriver-> switchTo () - & gt; window (end ($ __ handles ));}); // VK popup load codecept_debug ($ I-> grabTextFrom ('# install_allow')); $ I- & gt; SeeElement ('box_login.'); $ I- & gt; Bharfeld ('email', '******'); $ I- & gt; Bharfeld ('Pass', '******'); $ I- & gt; ($ I- & gt; grabTextFrom ('# install_allow')); $ I- & gt; DontSeeElement ('oauth_error.'); The line is successfully implemented in this test, but at the end, Codeception throws a "no window" complaint about an exception:    

    [NoSuchWindowException] window found. The browser window may close. Create information: Version: '2.45.0', Modification: '5017cb8', Time: '2015-02-26 23:59:50' System Information: Host: '***', IP: '***', Os.name: 'linux', os.arch: 'amd64', os.version: '3.2.0-4-amd64', java.version: '1.7.0_65' driver information: driver.version: unknown

    The question is how to run this test easily, how to manage this situation? $ I-> switchToWindow (); does not help.

    *** Update: Resolved. The answer is simple: $ I-> DontSeeElement ('.aauth_error'); is removed when the window closes first so we need to switch the window first, and only then there is some claim.

    "itemprop =" text ">

    We had the same problem authentication with OAuth2.

    We inject javascript to give a known name to the main window, so we can switch popup and Webdriver lost its context after the window disappears.

      $ i - & gt; Executed JS ('old_window_name = windowname; window; name =' menu window ');  

    Then it is a full user step method to handle a popup login

      public function openLoginPopup () {$ I = $ this; $ I- & gt; AmOnPage (\ MainMenuPage :: $ url); $ I- & gt; DoWait (); $ I- & gt; Execution js ('old_window_name = windowname; window; name = "mainwindows"'); $ I- & gt; Click (\ MainMenuPage :: $ loginButtonLocator); $ I- & gt; SwitchToWindow (\ LoginPage :: $ windowName); } Public function fillloginform ($ username, $ password) {$ I = $ this; $ I- & gt; Bharflild ('_username', $ username); $ I- & gt; Fill field ('_ password', $ password); } Public event submitLoginData () {$ I = $ this; $ I- & gt; Click (\ LoginPage :: $ loginButtonLocator); $ I- & gt; SwitchToWindow ('MainWindow'); $ I- & gt; ExecuteJS ('window.name = old_window_name'); }  

    hh


    c# - No characters from foreign languages while using ActionLink -


    जब मैं

      @ html.DisplayFor (modelItem = & gt; item.Collection) का उपयोग करता हूं। नाम)  

    सब कुछ ठीक है, लेकिन जब मैं इसका उपयोग करता हूं:

      @ html.ActionLink (@ html.DisplayFor (modelItem = & gt; item .collection.Name) + "", "अनुक्रमणिका", नया {})  

    कोई भी विदेशी वर्ण नहीं हैं सबसे पहले एक "żółć" प्रदर्शित करता है, दूसरा - " ż & amp; # 243; łć " ऐसा क्यों है? इसे कैसे ठीक करें?

    के अनुसार, Html.DisplayFor के उद्देश्य से है

    अभिव्यक्ति अभिव्यक्ति द्वारा प्रदर्शित वस्तु के प्रत्येक गुण के लिए HTML मार्कअप लौटें।

    लेकिन आपका ActionLink बस

    @ Html.ActionLink (Html.DisplayNameFor (modelItem = & gt; item.Collection.Name)। टॉस्ट्रिंग (), "इंडेक्स", नया {})

    देखें


    angularjs - Displaying an specific image for each item in ng-repeat -


    I have a ng-repeat that shows a list of games and beside each game name I want to display a specific image. I want to know how to go about displaying the right PNG for every game. How can I know how the image will appear? Here's how the code looks.

      & lt; Div ng-if = "sport.leagues.length & game check" ng-repeat = "play in game" & gt; & Lt; Ion-list class = "list" & gt; & Lt; Div class = "item" & gt; & Lt; Img src = "" class = "sports-image" & gt; & Lt ;! - Here's where IMG should be - & gt; & Lt; Period & gt; {{Sport.name}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Ion list & gt; & Lt; / Div & gt;  

    I think you can see the image based on a key (like the name of the game) Want to You can place a Javascript object as the name with the key in your controller and the value can be the URL of the image

    obj = {football: 'myurl'}

    < / Blockquote>

    and use this object

      & lt; Div ng-if = "sport.leagues.length and sports check" ng-repeat = "play in gamefilter = (game | gamefield: query)" & gt; & Lt; Show-remove ion-list = "sport.showStars" class = "list" & gt; & Lt; Div class = "item" & gt; & Lt; Img ng-src = "{{obj [sport.name]}}" class = "sports-image" & gt; & Lt ;! - Here's where IMG should be - & gt; & Lt; Period & gt; {{Sport.name}} & lt; / Span & gt; & Lt; / Div & gt;  


    java - Creating object and reading from file -


    I have no object to me and I can make it with two constructor

      public Brick (int x, int y) {..........}  

    and

      public brick (int x, int y , float sizeX, float size (y) {}  

    I have in map.txt to me

      brick 320 brick 0 640 64 64 128 spike 5 12 Spike 75 25 .. ... ...  

    And here I read that file

      filehandle file = Gdx.files.internal ("Data / Map Text"); StringToken Zahoor token = new Stringtoknaijhr (file.readString ()); while (TokenskhasMoreTokens ()) string {type = Toknknakstokn (); If (type.equals ( "block")) {list.add (new brick ( int. Parasiaint (token. Anakstikn ()), integer. Piaraiaiaianti (token. Anakstikn ()), float. Piarsaflot (token. Anakstikn ()), float. Prsflot (token. Next token ())));}  

    So I need to read my file that both of my constructors will work?

    If there is a command in each row, then I will read it in a row like this:

    Pre> import java.io.buffferedReader; Import java.io.FileInputStream; Import java.io.InputStream; Import java.io.InputStreamReader; Import java.nio.charset.Charset; Import java.util.StringTokenizer; Public class read {public static brick {public brick} (int a, int b) {System.out.println ("constructor for 2 parameters:" + + a + "," + b) "} public brick (int a, int b, int c, int d) {println ( "Creator 4 parameters:" + a + "," + B + "," + c + "," + e);}} public static void I (String [] Args) Exception {String Line; InputStream fis = New FileInputStream ("map.txt"); InputStreamReader isr = New InputStreamReader (FIS, Charset. Name ("UTF-8")); Buffett reader br = new buffed reader ISR); while ((r Eat = br.readline ()) = null) {//System.out.println(line); stringTokenizer token = new stringTokenizer (line.trim); while (tokens.hasMoreTokens ()) {string type = tokens .nextToken (); if (type.equals ("brick")} {int parameter = tokens.countTokens (); switch (parameter) {case 2: New Brick (Integer.parseInt (tokens.nextToken ()), Integer parseInt (tokens.nextToken ())); break; case 4: new brick (Integer.parseInt (tokens.nextToken ()), Integer.parseInt (tokens.nextToken ()), Integer.parseInt (tokens.nextToken ()) , Integer.parseInt (tokens.nextToken ())); break; Default: Throw new exception ("wrong row:" + line); }; }}}}}


    ldap - How to integrate Ping Federate IDP with OpenLDAP? -


    I have configured Open LipEp to store user information.

    In Ping Federate, I have OpenLedep Connection Information. LDAP connection has been established. How can I give the search filter I am using the HTTP Basic Adapter on the PF IDP side? I have given something like: cn = $ username

    The following OpenLDAP directory servers have user information.

    DN: CN = John Smith, or = People, DC = Harvard, DC = Com Object Class: Inteorge Pieceron CN: John Smith CN: John J Smith SN: Smith UID: Jasmith User Password : JSMTH or: Sales

    On Single Sign-On Certification, I gave: Username: uid password: userpassword

    In the OpenLDAP directory, from user information. But I can not reach SP processing.

    Please tell me about the configuration information that I should provide at the PING Fedit side.

    Thanks, Asini J.

    You will manage it in your password credential valitor You are assigned to the HTTP Basic Adapter. If the user is providing the attribute value stored in the "UID" attribute, you typically specify the search filter for "UID = $$ username" and "DC = Higher Rhodes, DC = COM" as the search base for PCV will do. . You can make this more complex / specific to ensure that you only return only one user identity from your LDAP.


    hadoop - FileNotFoundException sequence files Mahout -


    I'm reading the Apache Mahout Cookbook But I have a problem in Chapter 2, making a sequence file I'm using Mahavat 0.9

    The order I am executing is as follows:

      $ MAHOUT_HOME / Bin / Mahavat seqdirectory I / house / haritz / escritorio / work_dir / original -o / home / haritz / escritorio / work_dir / sequencefiles  

    but I received the following error:

    < Running on Hadoop, using / usr / local / Hadoop / bin / Hadoop and HADOOP_CONF_DIR = Mahout jobs: /home/haritz/mahout-distribution-0.9/mahout-examples-0.9-job Jar 15/03/16 16:45:57 information common.Abst ractJob: Command-line arguments: {--charset = [UTF-8], --chunkSize = [64], --endPhase = [2147483647], --fileFilterClass = [org.apache.mahout.text.PrefixAdditionFilter], - -input = [/ home / haritz / escritorio / work_dir / original], --keyPrefix = [], --method = [mapreduce], --output = [/ home / haritz / escritorio / work_dir / sequencefiles], - StartPhase = [0], --tempDir = [temp]} 15/03/16 16:45:58 WARN util.NativeCodeLoader: Unable to load the original-hysop library for your platform ... builtin-java classes Use where applicable 15/03/16 16:45:58 Configure information Ion.deprecation: mapred.input.dir dislikes Instead, use mapreduce.input.fileinputformat.inputdir 15/03/16 16:45:58 INFO configuration.depr Ecation: mapred.compress.map.output is disliked, instead, use mapreduce.map.output.compress 15/03/16 16:45:58 INFO Configuration.deprecation: mapred.output.dir dislikes, instead, the formula using mapreduce.output.fileoutputformat.outputdir exception "main" JavakiokFileNotFoundException: file does not exist: / home / haritz / Escritorio / work_dir / original org.apache.hadoop.hdfs.DistributedFileSystem org at $ 18.doCall on .apache.hadoop.fs.FileSystemLinkResolver.resolve (FileSystemLinkResolver.java:81) on org.apache.hadoop.hdfs.DistributedFileSystem $ 18.doCall (DistributedFileSystem.java:1114) (DistributedFileSystem.java:1122) on org.apache .hadoop.hdfs.DistributedFileSystem.getFileStatus (DistributedFileSystem.java:1114) org.apache.mahout.text.SequenceFilesFromDirectory.runMapReduce (SequenceFilesFromDirectory.java:162) org.apache.mahout.text.SequenceFilesFromDirectory.run (SequenceFilesFromDirectory.java). : 91) org.apache.hadoop.util.ToolRunner.run (ToolRunner.java:70) at org.apache.hadoop.util.ToolRunner.run (ToolRunner.java:84) at org.apache.mahout.text. Sequencefilereed directory Maine (Anukrmfailondairectori. Jawaः 65) sun.reflect.DelegatingMethodAccessorImpl on java.lang.reflect.Method.invoke on KreflectkNativeMethodAccessorImplkinvoke0 (Native Method) SunkreflectkNativeMethodAccessorImplkinvoke (NativeMethodAccessorImplkjava:57) sun. invoke (DelegatingMethodAccessorImpl.java:43) on org.apache.hadoop.util.ProgramDriver.run (ProgramDriver.java:144) on org.apache.hadoop.util.ProgramDriver $ ProgramDescription.invoke (ProgramDriver.java:71) to ( Method.java:606) On organization. apache.hadoop.util.ProgramDriver.driver org.apache.mahout.driver.MahoutDriver.main (Native Method (ProgramDriver.java:152) (MahoutDriver.java:195) on sun.reflect.NativeMethodAccessorImpl.invoke0) on the sun . reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57) on org.apache.hadoop on sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke (Method.java:606) Main (RunJar.java:1236)

    Can anyone tell me that .atil.RunJar.run (RunJar.java, June 21) org.apache.hadoop.util.RunJar Why do I get this exception? Thanks!

      is hoping hdfs path for input and output. If Hdfs path Mahout seqdirectory -i Acdifs-path (hdfs: // ip / user / -) -o Acdifs-path (hdfs: // ip / user / ..) you want it to run locally, so it needs to set the input system and output from the local file in the local file system, you / bin / mahout Shell file MAHOUT_LOCAL = true  

    mysql - split one or more record from a colums record with specific element -


    I will explain myself a little better: I am contrary to the tragedy that a programmer is facing in front of me. There is a field called a title which is divided by more tags than the inside comma, I need the id field of record, divide the strings and two or multiple records with the ID taken by each primary key and coma Receive.

    I insert a screen of the situation Can you help me?

    Use the SUBSTRING_INDEX function. SUBSTRING_INDEX ('Kodak Box, EduNeto Preezy', ',', - 1) ASA, SUBRITITIINXX ('Codice Exploies'), select the code as 'Selection' , 'AdMenanto Prize', ',', 1)

    Output

      + --------------- ------------ --------- + -------------------- + ------- --------- + | Field | Parta | | Partb | + ------------------------------------ + ------------ - + ----------------------- + | Kodis Aptty, EduGomento Prize. Edigando Prezhi | Kodis Applicability | + ------------------------------------ + ------------ -------- + ---------------- +  

    angularjs - Multiple script links in index.html -


    I have found a small project in angular. I am trying to keep everything in a liability manner and I I am very happy with the structure. The only index that I think does not look very good is index.html. All JS files are included in the lower part of the file and I do not see it. I'm adding more files (controllers, services, etc.) as I go and the list can be quite long.

    So my question is: Is this normal, is it all included in the index file or are there the way to move them all into one file and reference index.html?

      & lt; Html & gt; & Lt; Top & gt; ... & lt; / Head & gt; & Lt; Body & gt; ... ... & lt; Script src = "property / js / angular.js" & gt; & Lt; / Script & gt; & Lt; Script src = "property / js / angular-way.js" & gt; & Lt; / Script & gt; & Lt; Script src = "property / js / angular-touch.js" & gt; & Lt; / Script & gt; & Lt; Script src = "property / js / angular-sanitize.js" & gt; & Lt; / Script & gt; & Lt; Script src = "asset / js / angel-animate.mm.js" & gt; & Lt; / Script & gt; & Lt; Script src = "asset / js / jazzery-2.1.3mms.js" & gt; & Lt; / Script & gt; & Lt; Script src = "assets / js / bootstrap.money.js" & gt; & Lt; / Script & gt; & Lt; Script src = "app / app.js" & gt; & Lt; / Script & gt; & Lt; Script src = "app / app.routes.js" & gt; & Lt; / Script & gt; & Lt; Script src = "Controller / Controller On. Js" & gt; & Lt; / Script & gt; & Lt; Script src = "admin / controller two two .js" & gt; & Lt; / Script & gt; & Lt; Script src = "Controller / Controller with" Js "& gt; & Lt; / Script & gt; & Lt; Script src = "directives / directiveOne.js" & gt; & Lt; / Script & gt; & Lt; Script src = "directives / directiveTwo.js" & gt; & Lt; / Script & gt; & Lt; Script src = "services / serviceOne.js" & gt; & Lt; / Script & gt; & Lt; Script src = "services / serviceTwo.js" & gt; & Lt; / Script & gt; & Lt; Script src = "services / serviceThree.js" & gt; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

    Update 07/04/2015

    I have finished using GLUP for those looking for some help on this , I have followed this short tutorial:

    There are some possible solutions that I know automatically Will use your script tag for index.html:

    1. Using - Task / Build Runner You can use it:

      A stylesheet for bunch, java Script and webcontent reference injection plugin

    2. - Javascript Task Runner You

    3. Other Inject the references to files in files (looks like scripts and stylesheets in an HTML file)

    4. Option to see which I have not used -

    You can find many discussions on Gulp versus Grunt, both can make your life easier and solve your problem.

    See:


    c++ - STL: std::bind1st for std::unary_function -


    AFAIK std :: bind1st एक द्विआधारी functor और एक पैरामीटर लेता है, पहले ही बाध्य पहले पैरामीटर क्या एसटीएल std :: bind1st के समान एक फ़ंक्शन प्रदान करता है, जो एक समान समारोह और पैरामीटर लेता है, और पैरामीटर के बिना फ़ंक्शन देता है?

    संपादित करें: मुझे ज़रूरत है सी ++ 11 से पुराने संस्करणों के लिए एक समाधान (मैंने उस टैग को नहीं रखा है)

    एक तरह से एक बाइंडर स्वयं लिखना है

      टेम्पलेट & lt; typename फ़ंक्शन, typename ARG_TYPE, typename RETURN_TYPE & gt; Struct bind_it {फ़ंक्शन फ़ंक्शन; ARG_TYPE तर्क; Bind_it (ARG_TYPE मान, फ़ंक्शन F): फ़ंक्शन (f) {argument = value; } RETURN_TYPE ऑपरेटर () () {रिटर्न फ़ंक्शन (तर्क); }};  

    मुझे यकीन है कि एक बांधने की मशीन लिखने के लिए बेहतर तरीके हैं

    और इसे उपयोग करें

      int f (int i) {return i + 2; } Int main () {bind_it & lt; int (*) (int), int, int & gt; बाध्य (5, च); Int se7en = बाध्य (); }  

    vb.net - Case Statement not working with String Literals -


    Hi all I'm trying to learn VB and I'm having problems with some code I have a specific for production Based on the number my program requires, a check box is checked using case statements, but my code is not working.

      as the object public class frmBTPW Private Sub Form1_Load (, e EventArgs) as handle MyBase.Load End Sub private Sub Button1_Click (object, such as e EventArgs ) handles btncalc.Click dim dblhdr double dim dblfdr double dim dbltdr as double dblhdr = 24 dblfdr = 35 dbltdr = 50 select case "as the Power wash rental" case "half-day rental" chkhd.Checked = truth txtrc.Text = If "poop full day rental" case then "finish" if chkFD.Checked = truth txtrc.Text = dblfdr end if you choose end end Sub possession Function Button1_Click () checkbox as new NotImplementedException Closing Ceremony throw-ended Class  

    aid is not outputting anything appreciated.My code text-B ox.

    Beyond case statement, respectfully I think that you should read on the difference between a literal value And a convertible "Power Wash Rental" is nothing more than a series of characters, aka AK is a string (similar in this case since the "P" "O" etc.), "a series of rent half day" characters "H" of the following "a" etc.)

    "Power wash rental" is a literal string "" half-day rental "and of course they will not match ever

    While:.

      string one as a dim = TextBox1.text  

    Now, a variable Land. This is the type is a string that contains the series of text (text) text box.


    Java: How can i remove null value from a string? -


    When this code is run, it outputs to nulli . Why is this doing?

      public static zero main (string [] args) {string [] a = new string [1]; String m = null; String c = "hi"; For (int i = 0; i & lt; c.length (); i ++) {a [0] = a [0] + c. Art et al. (I); } System.out.print (a [0]);  

    Before the loop, type:

      A [0] = "";  

    i.e.

      public static zero main (string [] args) {string [] a = new string [1]; String m = null; String c = "hi"; A [0] = ""; For (int i = 0; i & lt; c.length (); i ++) {a [0] = a [0] + c. Art et al. (I); } System.out.print (a [0]); }  

    DataTables/jQuery UI Tabs header width bug -


    Then there is a famous bug with DataTables + jQuery UI tabs, where the column headers are not handled properly due to data hal It is initially hidden, it prevents the sort icon from being displayed as a screen out of the width -

    In the above link, it determines that in this tab, fix it with the on activated method:

      $ ("# Tab "). Activate: function (event, UI) {$ ("#image"). Datatale (.columns.adjust (); chrome.storage.local.set ({" CurrentTabIdx ": ui.newPanel [0] .dataset [" tabIndex "]});}});  

    However, as you can see that I am saving that tab that was selected so that when the user reloads the page, the same tab was left Which was open.

    At the reload, the tab that was selected shows that the activate is not an incident, because the tab is not selected, only loaded.

    I have tried to adjust the column inside active , load , create methods, but nothing works Does

    Is this the solution?

    I create 3 tabs with each of my datasets, I use Scrolling as shown in the link from Datatables.net Use it here

      $ (document) .ready (function () {// In this section the data is set and the data is based on dtdata = JSON.parse (f) Column creates defintion.); Var key = object.kiz (dtdata.data [0]); Var column = []; $ .eEE (keys, functions (i, items) {column.push ({data: item, title: item, name: item}}}); // If it is there then get storage value then tab versus var ls = localStorage.getItem ("currentTabIdx"); If (ls === null) {ls = 1; LocalStorage.setItem ("tabs (active: ls-1, active: function (evt, ui) {var idx = ui.newPanel.index (); localStorage.setItem (" current tabidax ", idx);} CurrentTabIdx", Idx); if (! $ .fn.DataTable.isDataTable ("# table" + idx)) {$ ("# table" + idx) .DataTable ({Data: dtdata.Data, Columns: Columns, Order: [ Idx, "asc"]], scroll: 200, scroll escape: true, paging: wrong});}}}); // Getting highlighted table $ ("# Tables" + LocalStorageGet Item ("CurrentTabIdx")) Datatelle ({Data: dtdata.data, Columns: Columns, Order: [[LS, "ACC"]], Scroll: 200, Scroll Migration: True, Paging: Incorrect}); });  

    php - How do I use wc() in woocommerce? -


    I am working in woocommerce using the wc () function. It says that gives the main example of WC to stop the need to use Global.

    I can not find any examples of its use and I would like to know how to use wc () to do some basic things, I think it gives a main woocommerce example ; And from that I can get all the data that I want; But I do not know the syntax for the right use ... can there be something like this?

      $ foo = WC (); $ Bar = $ foo- & gt; Cart; Counterpart $ bar;  

    Can someone please correct it?

    In addition to this, I am trying to understand what are the benefits of doing this instead of doing varies.

    As the doctor says in your link, 'Prevent the need to use Global' Will ...

    The use of the code is global.

      global $ woocommerce; $ Customer_country = $ woocommerce- & gt; Customer- & gt; Mg ();  

    The code does not use the global

      $ customer_country = WC () - & gt; Customer- & gt; Get_country (); // Some servers can not like this way ... the best is to use variables like foo = wc (); Then $ foo- & gt; Customer- & gt; Use get_country () ...  

    How to use WC ()? ...


    c++11 - clang recursive type derivation error for template members -


    This code is usually compiled with gcc 4.8 and higher, but Not by clang ++ 3.5 and higher instead:

    ! Error: 'data & lt; Data & lt; Double, double & gt;, data & lt; Double, double & gt; & Gt; 'Data & lt; Double, double 'gt; '

    This means that only one example was generated for func (data & lt; double, double & gt;).

    Why neglected nested structures?

    Is this a bug in rub? Or go away from the GCC standard?

      template & lt; Class T1, Class T2 & gt; Structure data {T1 T1; T2T2; Data (T1T1, T2T2): T1 (T1), T2 (T2) {}}; Template & lt; Class T1, Square T2 & gt; The data is & lt; T1, T2 & gt; Make_Data (T1 t1, T2 t2) {Return Data & lt; T1, T2 & gt; (T1, t2);} straight foo {template & lt; Class T & gt; Static Double Funk (Constant T & T) {Return 0.1 * T;} Template & lt; Class T1, Square T2 & gt; Fixed Auto Funk (Constant Data & lt; T1, T2 & gt; & amp; D) - & gt; DeliType (make_data (funk (dt1), throw (dt2)) {return macadata (throw (dt 1), throw (dt2));}}; Template & lt; Class T & gt; Auto apply_func (const T & amp; t) - & gt; Decltype (foo :: func (t)) {return Foo :: func (t);} int main () {auto data = make_Data (make_Data (1,2), make_Data (3,4)); Auto Data 1 = Application_Funk (data); Return 0; }  

    As my struct foo template

      template & lt; Class T & gt; Structure FU {stable double function (CONST T & T) {return 0.1 * t;}}; Template & lt; Class T & gt; Auto apply_func (CONST T & T) - & gt; Deltipype (Foo & Lt; T & AC; :: Funk (T)) Foo & TT; T & AG :: Funk (T);} Template & lt; Class T1, Class T2 & gt; Static Auto Funk (Contact Data & lt; T1, T2 & gt; & amp; D) - & gt; Delitype (make_Data (apply_func (d.t1), apply_func (d.t2)) {FTA, returning_a_data (upper_funk (D. 1), applied_funk (D.2));}};  

    But the whis case function should be used in the apply_func implementation and should be declared before class specialization.


    How to find definition of library functions in C -


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

    • 5 जवाब

    फ़ंक्शन जैसे printf (), Scanf (), मैमेट (), puts () आदि में हेडर फाइल में उनकी घोषणा है लेकिन इन फ़ंक्शन की परिभाषा देखने के लिए कोई तंत्र है ..? यह एक नया प्रश्न नहीं हो सकता है लेकिन मुझे इसके लिए उचित समाधान नहीं मिल सका।

    • अपने कंपाइलरों को पाथ में शामिल करें (उदाहरण के लिए)
    • जिस शीर्षक में आप रुचि रखते हैं (जैसे printf को stdio.h में होना चाहिए या अधिक होने की संभावना है) stdio.h द्वारा शामिल हैडर
    • सही ढंग से कॉन्फ़िगर किया गया है, कुछ आईडीई आपको उसमें मदद करेंगे, उदा।

    इस विधि की इसकी सीमा हालांकि है, क्योंकि कुछ बिंदु पर फाइलें कम से कम मानक-सी मिलेंगी, लेकिन अधिक से अधिक कंपाइलर निर्भर। सी-मानक मानक शीर्ष लेखों की सामग्री को नहीं लिखता है। यह केवल बताता है कि यदि आप #include & lt; stdio.h & gt; लिखते हैं, तो आप printf () का उपयोग कर सकते हैं। इसका जरूरी मतलब नहीं है कि stdio.h का कोई रूप है जिसे आप चाहते हैं।


    Is there an equivalent of find_first_of c++ string method in javascript -


    I'm coming from C ++ background and currently working on the node.js server app. I want to know that the find_first_of C ++ string in the Java string is equal to the class method.

    Actually I would get a string like var str = "abcd = 100 & amp; efgh = 101 & ijkl = 102 & amp; mnop = 103" . & amp; Sorted words of can be random. So, I wanted to do something like the following:

      str.substr (str.find ("mnop =") + string ("mnop ="). Length, str.find_first_of ("  

    Is it in a row like this in a way?

    You can find the function useful.

      "Find the string first". Search ("find"); // 7  

    its Besides, you can find the question useful too.


    java - How to run task one last time before shutdown -


    मेरे पास एक ScheduledExecutorService जैसा है:

      अनुसूचित एक्सक्लूसर सेवा निष्पादक = एक्ज़ीक्यूटर्स। एनवेसिंलिंगटैब्रेड शेड्यूलेड एक्वाटर (); Executor.scheduleAtFixedRate (कमांड, 0 एल, रेट, टाइम यूनेट। एमआईएलआईएलएक्सएंडएनएस);  

    कुछ बिंदु पर, मुझे उसे बंद करना होगा लेकिन इससे पहले, मुझे यह सुनिश्चित करने की आवश्यकता है कि कमांड एक आखिरी बार चलाया गया था कुछ ऐसा

      सार्वजनिक शून्य बंद () {executor.waitOneMoreTime (); executor.shutdown (); }  

    मैं यह कैसे कर सकता हूँ? अगर मैं करता हूं

      सार्वजनिक शून्य बंद () {executor.shutdown (); निष्पादक। प्रवेश परीक्षा (दर, टाइम यूनिट। मिलिसेकंड्स); }  

    मेरी समझ यह है कि अनुसूचित कमांड को फिर से चलाने के लिए गारंटी नहीं दी जाएगी executor.shutdown () । क्या यह सही है?

    इस तरह से प्रयास करें:

      सार्वजनिक शून्य बंद () ({Executor.aitaitTermination (दर, TimeUnit.MILLISECONDS) का प्रयास करें; executor.shutdown (); } पकड़ (बाधित ईक्सेप्शन ई) {// अपनी त्रुटि दर्ज करें}}  

    logging - Why do loggers in Java rarely have the .toString() that System.out.println does? -


    मुझे अक्सर

      system.out.println (someObject) होने से नाराज़ होता है;  

    और, जो भी लॉगगर की आवश्यकता के लिए इसे बदलते हैं

    LOG.info (someObject);

    और .toString जोड़ने के लिए () इसे संकलित करने के लिए

      LOG.info (someObject.toString ());  

    मुझे याद नहीं आ रहा है कि एक लकड़हारा का प्रयोग किया जाता है जो ऑब्जेक्ट में बस नहीं लेता है और इस पर .to स्ट्रिंग () को करने की कोशिश करता है, जिससे मुझे आश्चर्य हो रहा है कि इसके लिए एक विशिष्ट कारण है। निश्चित रूप से मैं सब कुछ करने के लिए .toString () जोड़कर नाराज हो सकता है?

    कुंजी बिंदु लॉगिंग के उद्देश्य को समझना है लॉगर्स वहां किसी भी घटना के बारे में मानव पठनीय अंग्रेजी संदेशों को मुद्रित करने के लिए होते हैं जो एक आवेदन के भीतर होता है। और लॉगिंग एपीआई इस मूल सिद्धांत के बाद बनाई गई हैं

    LOG.info (someObject.toString ());

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

    ऑब्जेक्ट को सीधे लॉग करना, ज्यादातर डेवलपर्स द्वारा किया जाता है, जब वे कहने देने के लिए डीबग करना चाहते हैं वस्तु की सामग्री या ऐसा कुछ, इसलिए इसे प्राप्त करने का सबसे अच्छा तरीका सही तरीके से स्ट्रिंग () पद्धति को लागू करना होगा।

    मैं भी इसे देखने के लिए सलाह देता हूं, यह इसके लिए तैयार है अपनी बीन्स के सामान्य हैशोड () और टूस्ट्रिंग () कार्यों के कार्यान्वयन का उपयोग करें ताकि आपको अपने कोड के माध्यम से जाना और पद्धति को एक-एक करके लागू न करें।


    java - Why bundle loses data type of top-level array? -


    I am trying to exceed the 2-dimensional array of stars in my activity using the bundle:

      bundle. Input Extra ("Myadda", Serialable Array); ... data = bundle. Gate-serializable ("mydata");  

    Then, data.toString () returns [Ljava.lang.Object; @ 421b93e0 .

    In general Java, the string of the same deserialized object is represented by [[Ljava.lang.String; @ 32d16dc8 .

    Why does the bundle pass its data in such a strange way? Can I put it in my array in every object by string []

    without a normal Am I

    google api - Drive Api Java : MediaContent & MediaSource alternative for Drive Api -


    Using Drive API, I want to send a file as an attachment ("do not want to save it in Drive").

    Earlier I was using the 'Document List API' to use these sections

      com.google.gdata.data.MediaContent com.google. Gdata Data.media.MediaSource  

    Now, I want to get the same using drive API classes. So what are the options for these classes in drive ap?


    php - Automatically update date column in database -


    Hello I have a page that accepts responses based on whether or not a transaction succeeds.

    I am trying to update my database record in the case of a successful transaction and update the current date on the start date and also the expiration date after one year I automatically update.

    Currently I have been able to update the tracing position for 'Paid', but there is no clue on how to do it for the dates. I want to do it automatically

    This is what I have done

      $ tnx_ref = $ _SESSION ['genref']; $ Sql ​​= "Update Transactions" "Set Transaction_Status = 'Paid', 'Start_Date =' start ', Expiryet =' End '". "WHERE tnx_ref = $ tnx_ref";  

    With this, the status of transaction was started for paid , start and expiry /

    You can use

    date / ADAD Set transaction transaction as and curdate function

      Transaction_Status = 'paid', Start_Date = curdate (), Expiry_Date = date_add (curdate) ), Interval 1 year) where TNX_F = $ tnx_f  

    update with date for the "date of expiration" Or if I want to reduce it one day. " Transactions SET Transaction_Status = 'paid', Start_Date = curdate (), Expiry_Date = date_sub (date_add (curdate, interval 1 year), interval 1 day) WHERE tnx_ref = $

      Tnx_ref  

    python - matplotlib: change individual cell dimensions in heatmap -


    I am creating a heatmap using Matplotlib, but I can create my own based on other information for every cell I want to keep the dimension of Thus, I am currently producing heatmap:

      fig, ax = plt.subplots () ax.pcolor (data t., Cmp = plt.cm.Reds, edgecolors = ' K ') Ax.set_xticks (np.arange (0, 50) + 0.5) ax.set_yticks (np.arange (0, 50) + 0.5) ax.set_xticklabels (keys, minor = false, font size = 7) ax.set_yticklabels (Keys, minor = false, font size = 10) ax.invert_yaxis () plt.show ()  

    which produces a good heatmap but with all the cells with all dimensions, I want to change (individually). Thanks for any help (:


    django - Using StringIO With Python 3.4 -



    django - Using StringIO With Python 3.4 -

    so i'm using python 3.4 code isn't working. importing cstringio , i've fixed it's getting unexpected error.

    heres error:

    traceback: file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/core/handlers/base.py" in get_response 111. response = wrapped_callback(request, *callback_args, **callback_kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/contrib/admin/options.py" in wrapper 567. homecoming self.admin_site.admin_view(view)(*args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/utils/decorators.py" in _wrapped_view 105. response = view_func(request, *args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/views/decorators/cache.py" in _wrapped_view_func 52. response = view_func(request, *args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/contrib/admin/sites.py" in inner 204. homecoming view(request, *args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/contrib/admin/options.py" in add_view 1437. homecoming self.changeform_view(request, none, form_url, extra_context) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/utils/decorators.py" in _wrapper 29. homecoming bound_func(*args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/utils/decorators.py" in _wrapped_view 105. response = view_func(request, *args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/utils/decorators.py" in bound_func 25. homecoming func.__get__(self, type(self))(*args2, **kwargs2) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/db/transaction.py" in inner 394. homecoming func(*args, **kwargs) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/contrib/admin/options.py" in changeform_view 1388. self.save_model(request, new_object, form, not add) file "/home/callumb/webapps/photo/lib/python3.4/django-1.7-py3.4.egg/django/contrib/admin/options.py" in save_model 1029. obj.save() file "/home/callumb/webapps/photo/app/images/models.py" in save 77. self.create_thumbnail() file "/home/callumb/webapps/photo/app/images/models.py" in create_thumbnail 50. image = image.open(stringio(self.image.read())) exception type: typeerror @ /admin/images/image/add/ exception value: initial_value must str or none, not bytes

    and here code:

    def create_thumbnail(self): if not self.image: homecoming pil import image io import stringio, bytesio django.core.files.uploadedfile import simpleuploadedfile import os thumbnail_size = (280, 600) django_type = self.image.file.content_type if django_type == 'image/jpeg': pil_type = 'jpeg' file_extension = 'jpg' elif django_type == 'image/png': pil_type = 'png' file_extension = 'png' image = image.open(stringio(self.image.read())) image.thumbnail(thumbnail_size, image.antialias) temp_handle = stringio() image.save(temp_handle, pil_type) temp_handle.seek(0) suf = simpleuploadedfile(os.path.split(self.image.name)[-1], temp_handle.read(), content_type=django_type) self.thumbnail.save( '%s_thumbnail.%s' % (os.path.splitext(suf.name)[0], file_extension), suf, save=false )

    the traceback telling stringio expects string providing bytes. utilize bytesio instead os stringio.

    python django io python-3.4

    How can we use Tinkerpop Blueprints in Orientdb? -



    How can we use Tinkerpop Blueprints in Orientdb? -

    i want utilize blueprints , pipes in orientdb. method? , tinkerpop3 or tinkerpop2? improve learning experience?

    the latest versions of orientdb natively implement blueprints api, "using blueprints" virtue of using orientdb. pipes general dataflow framework , can used blueprints graph. utilize maven , add together pipes , orientdb dependencies in order build project maven help manage dependencies you.

    with respect tinkerpop2 or tinkerpop3, might want refer this:

    learning blueprints, should move straight tinkerpop 3?

    however, note orientdb not yet implement tinkerpop3, if interested in backend, have work in tinkerpop2 now.

    orientdb tinkerpop tinkerpop-blueprint tinkerpop-frames

    Java HttpClient get response from Post method -



    Java HttpClient get response from Post method -

    i new httpclient , i'm trying prices of players in fifa ultimate team web app.

    using developer tools, managed find post method yielding prices of player.

    searching specific player gives next url request. https://utas.s2.fut.ea.com/ut/game/fifa15/transfermarket?maskeddefid=20801&start=0&num=16&type=player

    when i'm viewing response of method, can see player prices on market in developer tools.

    so tried code in java prices, output nil response given in developer tools.

    this code:

    httpclient client = new defaulthttpclient(); string url = "https://utas.s2.fut.ea.com/ut/game/fifa15/transfermarket?maskeddefid=20801&start=0&num=16&type=player"; httppost loginpost = new httppost(url); loginpost.setheader("host", "utas.s2.fut.ea.com"); loginpost.setheader("connection", "keep-alive"); loginpost.setheader("content-lenght", "1"); loginpost.setheader("cache-control", "max-age=0"); loginpost.setheader("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"); loginpost.setheader("origin", "https://www.easports.com"); loginpost.setheader("user-agent", "mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/37.0.2062.124 safari/537.36"); loginpost.setheader("content-type", "application/json"); loginpost.setheader("accept", "application/json"); loginpost.setheader("x-ut-sid", "23c19a93-32ac-4f52-9aab-21c6be112ede"); loginpost.setheader("x-ut-embed-error", "true"); loginpost.setheader("x-ut-phishing-token", "8649502695209937021"); loginpost.setheader("x-http-method-override", "get"); loginpost.setheader("referer", "https://www.easports.com/iframe/fut15/bundles/futweb/web/flash/fifaultimateteam.swf?cl=144469"); loginpost.setheader("accept-encoding", "gzip,deflate"); loginpost.setheader("accept-language", "nl-nl,nl;q=0.8,en-us;q=0.6,en;q=0.4"); loginpost.setheader("cookie", "cem-rememberlogin=mrllf4ua9qjaz1j1va8yrhwlh9jfealsccy1q3ja7wrewecjnf3h348jrrptnr3qxnhx-ykv6th3hwgepqgexdup2vmfeiwkayskhymujuyhf_fsou-fiv7ur2xvypqvo1kep_do0llaj5ztv1i8pawera57lpkmwxy5kzodnrtgbbpbbv2bjovplglpufwmbodmxelctqga7s2-nm3iczc0jqq2gmtdckj48vhstl3x3beut3ltfnvfet8elfif; path=/"); list <namevaluepair> nvps = new arraylist <namevaluepair>(); nvps.add(new basicnamevaluepair("maskeddefid", "20801")); nvps.add(new basicnamevaluepair("num", "16")); nvps.add(new basicnamevaluepair("start", "0")); nvps.add(new basicnamevaluepair("type", "player")); loginpost.setentity(new urlencodedformentity(nvps)); httpresponse response = client.execute(loginpost); httpentity entity = response.getentity(); string content = entityutils.tostring(entity); system.out.println(content);

    this response developer tools showing , need:

    {"auctioninfo":[{"itemdata":{"id":164674417976,"timestamp":1412181858,"itemtype":"player","pile":5,"resourceid":1929400641,"rating":93,"leagueid":0, etc}]}}

    this response: ?[][][][][][][][]?v?m-.nlou??+???q*jm,??s?rj?(?,jmq([]?[]g[]et???s??l[][]k[]??[]?6[][][] [] stands unknown character (square)

    so question is: how adjust code such response of requested url? help appreciated

    edit: had delete 'setted' headers: 'setted' headers still need:

    loginpost.setheader("host", "utas.s2.fut.ea.com"); loginpost.setheader("user-agent", "mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/37.0.2062.124 safari/537.36"); loginpost.setheader("x-ut-sid", "23c19a93-32ac-4f52-9aab-21c6be112ede"); loginpost.setheader("x-ut-embed-error", "true"); loginpost.setheader("x-ut-phishing-token", "8649502695209937021"); loginpost.setheader("x-http-method-override", "get");

    but here, values of "x-ut-sid" , "x-ut-phishing-token" not correct, not actual values (since copied them previous session). how should prepare code in order actual value?

    thanks in advance

    is there documentation? maybe have set manually encoding, like:

    loginpost.setheader("content-type", "application/json; charset=utf-8");

    maybe alter "utf-8" other charset (like 'iso-8859-1')

    java http-post apache-httpclient-4.x

    swift - Can we fade out Launch image xib in ios -



    swift - Can we fade out Launch image xib in ios -

    i new in ios have found many illustration of fading out of launch image customised image not launch image placed in image xcassets. there solution fade out launch image placed within image xcassets.please help me resolve.thank in advance.

    ios swift launchimage

    c# - Do synchronous sockets still allow for external user action? -



    c# - Do synchronous sockets still allow for external user action? -

    i'm developing client-server infrastructure file sharing, chat, , server tracking functions.

    i need create 3 persistent tcp connections each since they'll utilize separate protocols and, often, separate server instances. haven't begun design communication stuff because i'm uncertain type of scheme should design as: async or sync?

    if take async, benefits give me relative 3 other protocols?

    if take sync, 2 chat messages sent in short time span each other, example, subject 1 of them beingness lost, or delayed, due other one's send process?

    i hope question isn't unclear.

    there no difference between can accomplish sync , async. features of sockets api not change. phone call mechanism changes.

    the benefits of sync , async non-functional in nature. see also: should switch utilize async i/o default?

    this answers question asked. if there specific issue or confusion leave comment.

    c# sockets asynchronous chat

    angularjs - Can 1 html calls 2 different controller from 2 different external javascript? -



    angularjs - Can 1 html calls 2 different controller from 2 different external javascript? -

    i have html..

    <body ng-app="buybye"> <div id='welcomebanner' ng-controller="1stcontroller"> </div> <div id="inputctrl" ng-controller="2ndcontroller"> </div>

    then have 2 different javascript, 1 1stcontroller

    var app = angular.module('buybye', []) app.controller('1stcontroller', function($scope) {}

    and 1 2ndcontroller.

    var app = angular.module('buybye', []) app.controller('2ndcontroller', function($scope) {}

    but 1 controller works while other don't. because have 2 separate js files?

    thanks.

    it's happening because defining module buybye twice. instead should define once.

    var app = angular.module('buybye', []) var app = angular.module('buybye', []) app.controller('1stcontroller', function($scope) {}); app.controller('2ndcontroller', function($scope) {});

    angularjs angularjs-scope

    ruby on rails chaining 3 actions from one button -



    ruby on rails chaining 3 actions from one button -

    i have controller new, create, , edit actions, amongst others shown below. right now, have 3 buttons in form, 1 start new project (new), button save (create) , 3rd button edit project after created (edit).

    i'd create single button combine execution of 3 actions in sequence : new, create, edit.

    is possible?

    # /projects/new # /projects/new.json def new @project = project.new respond_to |format| format.html # new.html.erb format.json { render :json => @project } end end # /projects/1/edit def edit @project = project.find(params[:id]) end # post /projects # post /projects.json def create @project = project.new(params[:project]) respond_to |format| if @project.save format.html { redirect_to @project, :notice => 'project created.' } format.json { render :json => @project, :status => :created, :location => @project } else format.html { render :action => "new" } format.json { render :json => @project.errors, :status => :unprocessable_entity } end end end

    def create @project = project.new(params[:project]) respond_to |format| if @project.save format.html { redirect_to edit_project_path(@project), :notice => 'project created.' } format.json { render :json => @project, :status => :created, :location => @project } else format.html { render :action => "new" } format.json { render :json => @project.errors, :status => :unprocessable_entity } end end end

    ruby-on-rails ruby methods controller method-chaining

    internet explorer 9 - Website with javascript doesn't work in IE9 but in IE9's compatibility mode - how to force compatibility view? -



    internet explorer 9 - Website with javascript doesn't work in IE9 but in IE9's compatibility mode - how to force compatibility view? -

    i know there question this: force ie9 browser compatibility view

    but since adding:

    <meta http-equiv="x-ua-compatible" content="ie=9">

    to the head section , reloading page ctrl+f5 didn't help there must way.

    on website bxslider , according this: bxslider not working in ie9 replaced elements (which had empty href attribute) tags - still not effect. images of slider displayed in total size 1 below other. after activating compatibility mode site works perfect.

    i don't wanna rebuild application scratch forcefulness compatibility-view? or there @ to the lowest degree free debugging tool that? downloaded firefox addon ie tab has debugbar utilize have purchase premium version. don't know causing error...

    i found causing error: why javascript works after opening developer tools in ie once?

    so frustrating , simple. caused console.logs in script. without them works charm.

    javascript internet-explorer-9 bxslider

    java - Can't connect to appengine after deploying it. Error 404 -



    java - Can't connect to appengine after deploying it. Error 404 -

    i trying develop app backend via android studio. hence started default endpoint created when creating new endpoint module android project. when running locally works fine , can see "myapi" , acces sayhi() method. when deploying google cloud somehow doesn't work anymore. can't see api nor method in api explorer.

    after checking google console found out there error "-no handlers matched url" on error log.

    i changed name project-id in appengine-web.xml , turned on default api's google project. there else have done perchance wrong?

    moreover found out this: smartgwt-appengine-404-not-found might solution. unfortunately don't understand take care of cases , still don't how prepare it.

    thank much help!!

    appengine-web.xml:

    <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>myproject-id</application> <version>1</version> <threadsafe>true</threadsafe> <system-properties> <property name="java.util.logging.config.file" value="web-inf/logging.properties"/> </system-properties> </appengine-web-app>

    web.xml :

    <?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5"> <servlet> <servlet-name>systemserviceservlet</servlet-name> <servlet-class>com.google.api.server.spi.systemserviceservlet</servlet-class> <init-param> <param-name>services</param-name> <param-value>com.example.mymodule.app2.myendpoint</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>systemserviceservlet</servlet-name> <url-pattern>/_ah/spi/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>

    java google-app-engine android-studio

    linux - Get the load, cpu usage and time of executing a bash script -



    linux - Get the load, cpu usage and time of executing a bash script -

    i have bash script plan run every 5 or 15 mins using crontab based on load puts on server.

    i can find time of running script, load, memory usage , cpu usage not sure how find.

    can help me?

    also suggestions of rough benchmark help me decide if script puts much load , should run every 15 mins , not 5 mins.

    thanks in advance!

    you can utilize "top -b", top gives cpu usage, memory usage etc, insert these lines in script, process in background , terminate process testing overs.

    ssh server_name "nohup top -b -d 0.5 >> file_name &"

    \top process run in background because of &, -d 0.5 give cpu status @ every 0.5 secs, redirect output in file_name latter analysis.

    for killing process after test, insert next in script,

    ssh server_name "kill \`ps -elf | grep 'top -b' | grep -v grep | sed 's/ */ /g' |cut -d ' ' -f4\`"

    your main testing script should between top command , command killing top.

    i presumed running script client side, if not ignore "ssh server_name".

    if running client side, because of "ssh", asked password, avoiding follow these 3 simple steps

    this solve issue.

    linux bash load crontab resource-utilization

    python - Slice 1D Array in Numpy without loop -



    python - Slice 1D Array in Numpy without loop -

    i have array x shown below:

    x=np.array(["83838374747412e61e4c202c004d004d004d020202c3cf", "8383835f6260127314a0127c078e07090705023846c59f", "83838384817e14231d700fac09bc096808881e1c1bc68f", "8484835c535212600f860a1612b90fcf0fcf012a2ac6bf", "848484787a7a1a961bac1e731086005d005d025408c6cf", "8484845050620c300d500a9313e613e613012a2a5cc4bf", "838383757c7cf18f02192653070d03180318080101be6f", "8584845557570f090e830f4309e5080108012a2a2ac6df", "85858453536b07d608b3124c102a102a1026010101c61f", "83838384848411a926791c162048204820484d4444c3bf"], dtype=object)

    these concatenated hex values need piece in order convert integers , apply conversion factors. want array such as:

    [83,83,83,84,84,84,83,85,85,83]

    which equivalent of x[:,0:2] cannot piece in (10,) array. trying similar character array in matlab. doing on millions of rows why trying avoid loop.

    any help appreciated, thanks.

    if you're after first 2 characters each hex value, 1 alternative recast array dtype of '|s2':

    >>> x.astype('|s2') array(['83', '83', '83', '84', '84', '84', '83', '85', '85', '83'], dtype='|s2')

    this thought can generalised homecoming first n characters each string.

    arbitrary slicing of string arrays much more hard in numpy. answers on this stack overflow page explain why isn't best tool strings show can possible.

    alternatively, pandas library facilitates fast vectorized operations (being built on top of numpy). has number of useful string operations makes slicing whole lot simpler plain numpy:

    >>> import pandas pd >>> s = pd.series(x) >>> s.str.slice(2, 9) 0 8383747 1 83835f6 2 8383848 3 84835c5 4 8484787 5 8484505 6 8383757 7 8484555 8 8584535 9 8383848 dtype: object

    python arrays numpy slice

    git - Proper permissions for /var/www -



    git - Proper permissions for /var/www -

    i'm attempting clone private repo bitbucket /var/www on centos vps.

    i've generated ssh key pair on vps, , uploaded .pub file bitbucket (read-only) deploy key.

    the keys setup properly, because when connect using:

    ssh -t git@bitbucket.org

    it works fine:

    authenticated via deploy key. can utilize git or hg connect bitbucket. shell access disabled. deploy key has read access next repositories: <username>/<repo_name>: <deployment key nickname> -- <vps_username>@<vps_hostname> connection bitbucket.org closed.

    so far, good. when seek clone repo /var/www,i get:

    fatal: not create work tree dir '<repo_name>'.: permission denied

    when sudo it, get

    permission denied (publickey).

    i found note in bitbucket docs regarding said error:

    you used sudo when attempting connection not need utilize sudo when cloning repository or other ssh action bitbucket.

    it looks need run root permissions create tree, if do, isn't using ssh key correctly.

    so, chmod'd /var/www directory non-root user have write privileges, , worked fine. directory 777 (drwxrwxrwx), isn't good.

    is there improve way handle this? i'd /var/www 755, don't want mess around temporary chmod every time want update code...

    thanks in advance!

    make /var/www group-writable (chmod g+w /var/www) , alter grouping group trusted users (including you) fellow member of. if don't want open of /var/www perhaps can introduce level, /var/www/foo, open up.

    git bitbucket file-permissions centos6.5

    c++ - Variable Scope and passing Global variables -



    c++ - Variable Scope and passing Global variables -

    i have write programme calculate value of e given tolerance. must have separate file function calculate e , must utilize global variables. can't pass function. getting same answers output every time, don't think using global variables or calling function right? sorry in advance possible improper formatting code on here.

    #include<iomanip> #include<iostream> #include<cmath> #include<string> using namespace std; void find_e(); double tol = 0; double e; double euler = 2.718281828459045; double diff; string ans = "yes"; int main() { while(ans == "yes") { cout<<"this programme estimate value of euler's number desired tolerance"<<endl<<endl; cout<<"please input tolerance: "; cin>>tol; system("cls"); if(tol > 0.0) { find_e(); cout<<"the new value of e "<<fixed<<setw(12)<<setprecision(10)<<e<<endl; cout<<"the actual value of e "<<fixed<<setw(12)<<setprecision(10)<<euler<<endl; cout<<"the difference "<<fixed<<setw(12)<<setprecision(10)<<diff<<endl; } else { cout<<"you can't have negative tolerance"<<endl<<endl; } cout<<"would run again? yes yes, other key no\n\n"; cin>>ans; } system("pause"); homecoming 0; }

    and here function in separate file:

    #include<iomanip> #include<iostream> #include<cmath> #include<string> using namespace std; extern double e; double newe; extern double diff; int n = 1; extern double tol; void find_e() { { e = (n,(1+(1/n))); diff = abs(newe - e); newe = e; n++; } while(diff>tol); return; }

    c++ global-variables scope

    dart - Replacing an item in List causes NotFoundError in AngularDart -



    dart - Replacing an item in List causes NotFoundError in AngularDart -

    "replace" called if click on <a class="replace" href="#" ng-click="replace(musician.lastname)">[ repl ]</a>

    class="lang-dart prettyprint-override">void replace(final string lastname) { _zone.run(() { final address addressfromlist = _model.musicians.firstwhere((final address address) => lastname == address.lastname); final int index = _model.musicians.indexof(addressfromlist); _logger.info("replace $lastname (index: $index)"); _model.musicians[index] = new address("tina","turner"); }); }

    if index 0 (first one) works fails others:

    notfounderror: node before new node inserted not kid of node. stacktrace: #0 blinknode.insertbefore_callback_node_node (dart:_blink:270) #1 node.insertbefore (dart:html:23205) #2 node.insertallbefore (dart:html:22868) #3 dominsert (package:angular/core_dom/dom_util.dart:25:25) #4 animate.insert (package:angular/core_dom/animation.dart:44:19) #5 viewport.insert.<anonymous closure> (package:angular/core_dom/view.dart:75:22) ...

    gh: http://goo.gl/koeakc (replace function) gh: http://goo.gl/4ffylo (appcontroller)

    here js version: http://www.mikemitterer.at/fileadmin/sourcesamples/accordion/ (same result)

    in sample, if replace "mozart" "tina turner" works if replace "mercury" tt fails...

    dart angular-dart

    c++ - Using time_t with mysql instead of CURDATE -



    c++ - Using time_t with mysql instead of CURDATE -

    i trying remove 28 days current date, , utilize in mysql. don't want utilize curdate() have caching, ma doing :

    time_t curdate = time(0); struct tm * tm_curdate = gmtime(&curdate); char date_buf[11]; strftime(date_buf, 11, "%y-%m-%d", tm_curdate); std::stringstream buf; buf << "select ..." " my_date >= date_sub(" << date_buf << ", interval 28 day)" << " limit 1";

    unfortunately, wrong in there (it compiles, seems not render @ execution, if utilize curdate(), works fine ...), can't figure out what.

    any thought ?

    thanks.

    c++ mysql

    c++ - Memory leaks with recursive function using std::unique_ptr -



    c++ - Memory leaks with recursive function using std::unique_ptr -

    i haven't used std::unique_ptr before, kind of first effort trying utilize in recursion phone call following:

    #define crtdbg_map_alloc #include <stdlib.h> #include <crtdbg.h> #include <memory> struct s { s(int x = 0, int y = 0):x(x), y(y) {} int x; int y; std::unique_ptr<s> p; }; void bar(int i, std::unique_ptr<s> &sp) { i--; sp->p = std::unique_ptr<s>(new s(i, 0)); if (i > 0) bar(i, sp->p); } int main() { std::unique_ptr<s> b (new s()); bar(5, b); // detects memory leaks _crtdumpmemoryleaks(); }

    at end of program. find whatever memory allocated wasn't freed according _crtdumpmemoryleaks(); in visual c++ 2012 x86 running on windows 8 x64.

    everything destroyed correctly @ end of proper scopes you're checking memory leaks before destructor b gets called:

    struct s { s(int x = 0, int y = 0) :x(x), y(y) { std::cout << "built x=" << x << std::endl; } ~s() { std::cout << "destroyed x=" << x << std::endl; } int x; int y; std::unique_ptr<s> p; }; void bar(int i, std::unique_ptr<s> &sp) { i--; sp->p = std::unique_ptr<s>(new s(i, 0)); if (i > 0) bar(i, sp->p); } int main() { std::unique_ptr<s> b(new s()); bar(5, b); _crtdumpmemoryleaks(); // b hasn't been destroyed yet! }

    output:

    built x=0 built x=4 built x=3 built x=2 built x=1 built x=0 ["your code leaking" dump] destroyed x=0 destroyed x=4 destroyed x=3 destroyed x=2 destroyed x=1 destroyed x=0

    c++ c++11 recursion memory-leaks unique-ptr

    repository - Git removed commits on remote reappear -



    repository - Git removed commits on remote reappear -

    we have different branches our different versions of project. somehow section of commits dev branch merged production branch.

    we assumed git stash apply error on new branch , proceeded remove commits (there 5-6) git rebase -i {commit hash}^ , removed effected lines.

    we forcefulness pushed changes git force -f , seemed after of in room pulled down. made general notice have pull before doing on these branches , left day.

    this morning came , people pulled morning have commits re-appear in code, breaking things. of pulled lastly night, pull , fixed code.

    bitbucket doesn't show code changes in source code viewer, yet when @ commits broken commits show in timeline production branch.

    access repository has been revoked until prepare can no longer inspect have ideas on be?

    git repository bitbucket git-rebase git-remote

    html5 - Navigation bar with vertically centered elements -



    html5 - Navigation bar with vertically centered elements -

    i've been trying create navigation bar meets next criteria:

    spans 15% height. spans 100% width. navigation bar aligned top of site. elements within navigation bar vertically centered within it. the lastly menu alternative aligned far right of navigation bar.

    i've been playing <div> , <ul> implement elements. i've spent lot of time on , researched it. can't seem find way vertically center elements, images, if utilize percentage height. assume issue because <header> , <nav> elements block elements, div element, beingness "vertical-align" works on inline elements.

    questions, wise plenty provide easy answers:

    can utilize "vertical-align" on block elements if override "display" element "inline" value? seems reply negative. can right-align 1 <li> within <ul> while other <li> left-aligned? the way can work utilize fixed height values on navigation bar padding around elements. alternative or know of way can create work percentage height?

    basic code express i'd (assuming <html> , other foundational tags there, too; , aware code below doesn't work shows basic idea):

    <style> html, body { height: 100%; width: 100%; } .menu_bar { display: inline; /* element seems mess things pretty bad assume can't way. using <ul> within inline element allow me utilize vertical-align. */ height: 15%; width: 100%; background-color: #000000; } .menu_items { height: 100%; width: 100%; } .menu_logo { vertical-align: middle; text-align: left; } .menu_option1 { vertical-align: middle; text-align: left; } .menu_option2 { vertical-align: middle; text-align: left; } .menu_option3 { vertical-align: middle; text-align: right; } </style> <body> <header> <nav> <div class="menu_bar"> <ul class="menu_items"> <li class="menu_logo"><a href="#"><img src="images/logo.gif"></a></li> <li class="menu_option1"><a href="#"><img src="images/option1.gif"></a></li> <li class="menu_option2"><a href="#"><img src="images/option2.gif"></a></li> <li class="menu_option3"><a href="#"><img src="images/option3.gif"></a></li> </ul> </div> </nav> </header> </body>

    html5 css3 navigation vertical-alignment

    c# - WinRT XAML GridView not limited by RowHeight -



    c# - WinRT XAML GridView not limited by RowHeight -

    my page layout goes this:

    i have maingrid defined this:

    <grid.rowdefinitions> <rowdefinition height="100" /> <rowdefinition height="*" /> <rowdefinition height="75" /> </grid.rowdefinitions>

    i have header, footer, , main content.

    i have gridview in main content, middle row. gridview not have height declaration. when view page, gridview spills it's content beyond viewable area.

    my understand should limited above row definitions. missing here?

    c# xaml gridview windows-runtime

    What kind of blocks do create closure in Javascript -



    What kind of blocks do create closure in Javascript -

    after working long javascript, i'm still having problems coming terms closure!

    class="snippet-code-js lang-js prettyprint-override">(function() { var pages = ["one", "two", "three"]; (var index in pages) { var p = pages[index]; settimeout(function() { console.log(p); }, 500); } })();

    shouldn't above snippet print one, two , three? afaik p within closure created for block , should remain unchanged each of settimeouts pick them up! why printing 3 threes?

    javascript has function scope, not block scope. so, when looping on array (p.s. don't utilize for..in arrays), creating 3 closures. each closure create referencing same p variable. when timeouts run, all print "three" because printing same p variable.

    you need create new scope each element in array. lucky, javascript has built-in function this, .foreach.

    class="snippet-code-js lang-js prettyprint-override">(function() { var pages = ["one", "two", "three"]; pages.foreach(function(p){ settimeout(function() { console.log(p); }, 500); }); })();

    when runs, runs callback each element. when callback ran, new scope created each element, works properly.

    javascript closures

    How can I pass data to the Excel Sheet and process the data then resulted output need to retrive using Java? -



    How can I pass data to the Excel Sheet and process the data then resulted output need to retrive using Java? -

    i have excel sheet application. have pass parameters sheet excel sheet evaluates date , need read resulted info through using java. there api accomplish ? please help me suggesting right way finish it. give thanks you

    take @ http://poi.apache.org/

    this project has api's accessing ms office file formats java.

    the specific part excel found here: http://poi.apache.org/spreadsheet/index.html

    bye, markus

    java excel excel-formula

    How to pass parameter in Form Scope for REST services in ColdFusion? -



    How to pass parameter in Form Scope for REST services in ColdFusion? -

    today while working coldfusion 10 rest, got issues. not sure how pass info rest service in form scope. here rest enabled cfc,

    <cfcomponent rest="true" restpath="/crudservice" > <cfset variable.myquery = querynew("id,name","integer,varchar",[[1,"test1"],[2,"test2"],[3,"test3"]] )> <cffunction name="gethandlerjsonform" access="remote" httpmethod="get" restpath="/formtest" returntype="query" produces="application/xml"> <cfargument name="customerid" required="true" restargsource="form" type="numeric" > <cfquery dbtype="query" name="local.qrygetusername"> select name variable.myquery id = <cfqueryparam cfsqltype="cf_sql_integer" value="#customerid#"> </cfquery> <cfreturn local.qrygetusername> </cffunction> </cfcomponent>

    here cfm code, calling rest service,

    <cfset restinitapplication("e:\local workspace\cfcs\rest","myfirstrest")> <cfhttp url="http://cflocal.com/rest/myfirstrest/crudservice/formtest" method="get" > <cfhttpparam type="header" name="content-type" value="application/x-www-form-urlencoded" > <cfhttpparam type="formfield" name="customerid" value="1" > </cfhttp> <cfdump var="#cfhttp#">

    in statuscode getting 500 exception obtaining parameters ?

    please suggest whats going wrong here.

    rest coldfusion coldfusion-10

    c# - asp.net gridview Sorting by date -



    c# - asp.net gridview Sorting by date -

    i sorting date sql query , proper result.

    but apply

    gridview.useaccessibleheader = true; gridview.headerrow.tablesection = tablerowsection.tableheader;

    to gridview. sorted info gets unsorted.

    this.gridviewname.mastertemplate.enablesorting = true; this.radgridview1.mastertemplate.enablesorting = true sortdescriptor descriptor = new sortdescriptor(); descriptor.propertyname = "yourcolumnname"; descriptor.direction = listsortdirection.ascending; this.gridviewname.mastertemplate.sortdescriptors.add(descriptor); descriptorcolumnname new sortdescriptor() descriptorshipname.propertyname = "columnname" descriptorshipname.direction = listsortdirection.ascending seek

    c# asp.net sorting gridview

    Managing MySQL connections using HikariCP and Slick -



    Managing MySQL connections using HikariCP and Slick -

    i'm running scala application on software stack:

    mac os x 10.6.8 snow leopard mysql 5.1.46 java 1.6.0_65 scala 2.11.2 connectorj 5.1.33 hikaricp 2.1.0 slick 2.1.0

    i cannot why open connections mysql maintain staying open after shutting scala app down. right aspect threads_connected drops 16 downwards 1 (that console i'm executing 'show status' command.

    mysql> show status '%onn%'; +--------------------------+-------+ | variable_name | value | +--------------------------+-------+ | aborted_connects | 0 | | connections | 77 | | max_used_connections | 19 | | ssl_client_connects | 0 | | ssl_connect_renegotiates | 0 | | ssl_finished_connects | 0 | | threads_connected | 1 | +--------------------------+-------+ 7 rows in set (0.00 sec)

    the unusual thing see open connections db growing maximum number of open connections set in connection pool (hikaricp maximumpoolsize) every time run app hence can state connections never given connection pool reuse.

    according slick documentation using

    db withsession { implicit session => /* entering scope, getting 1 conn pool */ /* within session using connection i've gotten */ } /* here i'm out of 'withsession' scope, , connection should released */

    will take connection pool when entering scope , release out of scope

    am doing wrong or did wrong connection pool usage on software stack?

    connections counter of how many connection attempts have been made since lastly time started mysqld. counter increases; not decrease when connections end.

    that counter not number of current connections -- that's threads_connected.

    mysql slick hikaricp connector-j

    remote access to a private docker-registry -



    remote access to a private docker-registry -

    i'm trying setup private docker registry using image taken from: https://github.com/docker/docker-registry

    just running: docker run -p 5000:5000 registry

    i can pull/push from/to repository localhost, if seek access machine (using private address on same lan) fails error message:

    *2014/11/03 09:49:04 error: invalid registry endpoint https ://10.0.0.26:5000/v1/': https:// 10.0.0.26:5000/v1/_ping: forbidden. if private registry supports http or https unknown ca certificate, please add together `--insecure-registry 10.0.0.26:5000` daemon's arguments. in case of https, if have access registry's ca certificate, no need flag; place ca certificate @ /etc/docker/certs.d/10.0.0.26:5000/ca.crt*

    what drives me crazy can access using: curl 10.0.0.26:5000 and/or curl 10.0.0.26:5000/v1/search

    i don't understand , how should pass --insecure-registry flag.

    what missing here??? thanks!

    ok - found solution - after day of digging. turns out new client version refuses work private registry without ssl.

    to prepare - daemon on client machine should launched insecure flag:

    just type:

    sudo service docker stop # stop service

    and

    sudo docker -d --insecure-registry 10.0.0.26:5000

    (replace 10.0.0.26 own ip address).

    i expect docker guys add together alternative pull/push command line...

    edit - altenantively - can add together flag docker_opts env variable within /etc/default/docker... , sudo service docker restart

    edit 1 time again - seems docker guys on - , prepare come soon: https://github.com/docker/docker/pull/8935

    here's illustration of /etc/default/docker change:

    docker_opts="$docker_opts --insecure-registry myregistry:5000"

    docker remote-access docker-registry