Daily Archives

Articles indexed Thursday June 12 2014

Page 8/17 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Difference between 'scope' and 'namespace'?

    - by katriel
    What is the difference, in general, between the concepts of namespaces and scope? To my understanding, both describe the parts of a program in which a variable/object/method/function will be accessible. I understand that 'scope' tends to be a property of the variable (e.g., "This variable has global scope"), while a 'namespace' is a property of the program (e.g., "A Python function creates a local namespace"). Are there other differences? Global scope vs global namespace addresses a slightly narrower question: global namespaces in C++. http://www.alan-g.me.uk/tutor/tutname.htm states, There are a few very subtle differences between the terms but only a Computer Scientist pedant would argue with you, and for our purposes namespace and scope are identical. What are those subtle differences? Under what circumstances or with which kinds of languages do people use each concept?

    Read the article

  • pl/sql creating a function with parameterized cursor with return date

    - by user3134365
    create or replace FUNCTION get_next_sch_date(cert_id VARCHAR2,test_id VARCHAR2) RETURN DATE AS CURSOR next_sch_date(pb_id number,test_no varchar2) IS SELECT Sch_Controls,PBY_FRQ,START_AFTER__CAL_DAYS,PBY_DUE_BY,PBY_NEXT_SCH_TEST_DATE FROM ms_cmp_plan_pby WHERE pby_id=pb_id AND test_plan_id=test_no; l_new_date DATE; l_new_sch number; sch_ctrl VARCHAR2(100); pb_frq VARCHAR2(100); start_days NUMBER; due_days NUMBER; test_date DATE; pb_id NUMBER; test_no NUMBER; BEGIN OPEN next_sch_date(pb_id,test_no); loop FETCH next_sch_date INTO sch_ctrl,pb_frq,start_days,due_days,test_date; SELECT DISTINCT pby_rec_id INTO l_new_sch FROM ms_cmp_assignment_log WHERE ASSIGNMENT_ID=cert_id AND PLAN_ID=test_id; exit; end loop; CLOSE next_sch_date; RETURN l_new_date; Exception WHEN others THEN RETURN NULL; end; this is my function but i dont getting excepted result

    Read the article

  • Java Out of memory - Out of heap size

    - by user1907849
    I downloaded the sample program , for file transfer between the client and server. When I try running the program with 1 GB file , I get the Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at Client.main(Client.java:31). Edit: Line no 31: byte [] mybytearray = new byte [FILE_SIZE]; public final static int FILE_SIZE = 1097742336; // receive file long startTime = System.nanoTime(); byte [] mybytearray = new byte [FILE_SIZE]; InputStream is = sock.getInputStream(); fos = new FileOutputStream(FILE_TO_RECEIVED); bos = new BufferedOutputStream(fos); bytesRead = is.read(mybytearray,0,mybytearray.length); current = bytesRead; do { bytesRead = is.read(mybytearray, current, (mybytearray.length-current)); if(bytesRead >= 0) current += bytesRead; } while(bytesRead > -1); bos.write(mybytearray, 0 , current); bos.flush(); Is there any fix for this?

    Read the article

  • calling and killing a parent function with onmouseover and onmouseout events

    - by Zoolu
    I want to call the function upon the onmouseover="ParentFunction();" then kill it onmouseout="killParent();". Note: in my code the parent function is called initiate(); and the killer function is called reset(); which lies outside the parent function at the bottom of the script. I don't know how to kill the intitiate() function my first guess was: var reset = function(){ return initiate(); }; here's my source code: any suggestions and help appreciated. <!doctype html> <html> <head> <title> function/event prototype </title> <link rel="stylesheet" type="text/css" href="styling.css" /> </head> <body> <h2> <em>Fantastical place<br/>prototype</em> </h2> <div id="button-container"> <div id="button-box"> <button id="activate" onmouseover="initiate()" onmouseout="reset();" width="50px" height="50px" title="Activate"> </button> </div> <div id="text-box"> </div> </div> <div id="container"> <canvas id="playground" width="200px" height="250px"> </canvas> <canvas id="face" width="400px" height="200px"> </canvas> <!-- <div id="clear"> </div> --> </div> <script> alert("Welcome, there are x entries as of" +""+new Date().getHours()); //global scope var i=0; var c1 = []; //c is short for collect var c2 = []; var c3 = []; var c4 = []; var c5 = []; var c6 = []; var initiate = function(){ //the button that triggers the program var timer = setInterval(function(){clock()},90); //copy this block for ref. function clock(){ i+=1; var a = Math.round(Math.random()*200); var b = Math.round(Math.random()*250); var c = Math.round(Math.random()*200); var d = Math.round(Math.random()*250); var e = Math.round(Math.random()*200); var f = Math.round(Math.random()*250); c1.push(a); c2.push(b); c3.push(c); c4.push(d); c5.push(e); c6.push(f); // document.write(i); var c = document.getElementById("playground"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.moveTo(c3[i-2], c4[i-2]); ctx.bezierCurveTo(c1[i-2],c2[i-2],c5[i-2],c6[i-2],c3[i-1], c4[i-1]); // ctx.lineTo(c3[i-1], c4[i-1]); if(a<200){ ctx.strokeStyle="#FF33CC"; } else if(a<400){ ctx.strokeStyle="#FF33aa"; } else{ ctx.strokeStyle="#FF3388"; } ctx.stroke(); document.getElementById("text-box").innerHTML=i+"<p>Thoughts.</p>"; if(i===20){ //alert("15 reached"); clearInterval(timer);//to clearInterval must be using a global scoped variable. return; } }; //end of clock //setInterval(clock,150); var targetFace = document.getElementById("face"); var face = targetFace.getContext("2d"); var faceTimer = setInterval(function(){faceAnim()},80); //copy this block for ref. global scoped. function faceAnim(){ face.beginPath(); face.strokeStyle="#FF33CC"; face.moveTo(100,104); //eye line face.bezierCurveTo(150,125,250,125,300,104); face.moveTo(200,1); //centre line face.lineTo(200,400); face.moveTo(125,111);//left eye lid face.bezierCurveTo(160,135,170,130,185,120); face.moveTo(150,116);//left eye face.bezierCurveTo(155,125,165,125,170,118); face.moveTo(275,111);//right eye lid face.bezierCurveTo(240,135,230,130,215,120); face.moveTo(250,116);//right eye face.bezierCurveTo(245,125,235,125,230,118); face.moveTo(195, 118); //left nose face.lineTo(190, 160); face.lineTo(200,170); face.moveTo(190,160); //left nostroll face.lineTo(180,160); face.lineTo(191,154); face.moveTo(180,160); //left lower nostrol face.lineTo(200,170); face.moveTo(205, 118); //right nose face.lineTo(210, 160); face.lineTo(200,170); face.moveTo(210,160); //right nostroll face.lineTo(220,160); face.lineTo(209,154); face.moveTo(220,160); //right lower nostrol face.lineTo(200,170); face.moveTo(200,140); //outer triad face.lineTo(170, 100); face.lineTo(230, 100); face.lineTo(200, 140); face.moveTo(200,145); //outer triad drop shadow face.lineTo(170, 100); face.lineTo(230, 100); face.lineTo(200, 145); face.moveTo(200,130); //inner triad face.lineTo(180, 105); face.lineTo(220, 105); face.lineTo(200, 130); //face.lineWidth =0.6; face.moveTo(280,111);//outer right eye lid face.bezierCurveTo(240,140,230,135,210,120); face.moveTo(120,111);//outer left eye lid face.bezierCurveTo(160,140,170,135,190,120); face.moveTo(162,174); //upper mouth line face.bezierCurveTo(170,180,230,180,238,174); face.moveTo(165,175); //mouth line bottom face.bezierCurveTo(190,Math.floor(Math.random()*25+180),210,Math.floor(Math.random()*25+180),235,175); face.moveTo(232,204); //head shape face.lineTo(340, 20); face.moveTo(168,204); //head shape face.lineTo(60, 20); face.stroke(); //exicute all co-ords. }; //end of face anim var clearFace = function(){ document.getElementById('face').getContext('2d').clearRect(0, 0, 700, 750); }; setInterval(clearFace,90); }; //end of parent function var reset = function(){ document.getElementById('playground').getContext('2d').clearRect(0, 0, 700, 750); //clearInterval(faceTimer); //delete initiate(); }; </script> </body> </html>

    Read the article

  • A MongoDB find() that matches when all $and conditions match the same sub-document?

    - by MichaelOryl
    If I have a set of MongoDB documents like the following, what can I do to get a find() result that only returns the families who have 2 pets who all like liver? Here is what I expected to work: db.delegation.find({pets:2, $and: [{'foods.liver': true}, {'foods.allLike': true}] }) Here is the document collection: { "_id" : ObjectId("5384888e380efca06276cf5e"), "family": "smiths", "pets": 2, "foods" : [ { "name" : "chicken", "allLike" : true, }, { "name" : "liver", "allLike" : false, } ] }, { "_id" : ObjectId("4384888e380efca06276cf50"), "family": "jones", "pets": 2, "foods" : [ { "name" : "chicken", "allLike" : true, }, { "name" : "liver", "allLike" : true, } ] } What I end up getting is both families because they both have at least one food marked as true for allLike. It seems that the two conditions in the $and are true if any foods sub-document matches, but what I want is the two conditions to match for the conditions as a pair. As is, I get the Jones family back (as I want) but also Smith (which I don't). Smith gets returned because the chicken sub-doc has allLike set to true and the liver sub-doc has a name of 'liver'. The conditions are matching across separate foods sub-docs. I want them to match as a pair on a foods document. This code is not the real use case, obviously. I have one, but I've simplified it to protect the innocent...

    Read the article

  • C headers: compiler specific vs library specific?

    - by leonbloy
    Is there some clear-cut distinction between standard C *.h header files that are provided by the C compiler, as oppossed to those which are provided by a standard C library? Is there some list, or some standard locations? Motivation: int this answer I got a while ago, regarding a missing unistd.h in the latest TinyC compiler, the author argued that unistd.h (contrarily to sys/unistd.h) should not be provided by the compiler but by your C library. I could not make much sense of that response (for one thing shouldn't that also apply to, say, stdio.h?) but I'm still wondering about it. Is that correct? Where is some authoritative reference for this? Looking in other compilers, I see that other "self contained" POSIX C compilers that are hosted in Windows (like the GCC toolchain that comes with MinGW, in several incarnations; or Digital Mars compiler), include all header files. And in a standard Linux distribution (say, Centos 5.10) I see that the gcc package provides a few header files (eg, stdbool.h, syslimits.h) in /usr/lib/gcc/i386-redhat-linux/4.1.1/include/, and the glibc-headers package provides the majority of the headers in /usr/include/ (including stdio.h, /usr/include/unistd.h and /usr/include/sys/unistd.h). So, in neither case I see support for the above claim.

    Read the article

  • Symfony Form render with Self Referenced Entity

    - by benarth
    I have an Entity containing Self-Referenced mapping. class Category { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="name", type="string", length=100) */ private $name; /** * @ORM\OneToMany(targetEntity="Category", mappedBy="parent") */ private $children; /** * @ORM\ManyToOne(targetEntity="Category", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") */ private $parent; } In my CategoryType I have this : public function buildForm(FormBuilderInterface $builder, array $options) { $plan = $this->plan; $builder->add('name'); $builder->add('parent', 'entity', array( 'class' => 'xxxBundle:Category', 'property' => 'name', 'empty_value' => 'Choose a parent category', 'required' => false, 'query_builder' => function(EntityRepository $er) use ($plan) { return $er->createQueryBuilder('u') ->where('u.plan = :plan') ->setParameter('plan', $plan) ->orderBy('u.id', 'ASC'); }, )); } Actually, when I render the form field Category this is something like Cat1 Cat2 Cat3 Subcat1 Subcat2 Cat4 I would like to know if it's possible and how to display something more like, a kind of a simple tree representation : Cat1 Cat2 Cat3 -- Subcat1 -- Subcat2 Cat4 Regards.

    Read the article

  • Powershell 4 compatibility with Windows 2008 r2

    - by Acerbity
    In my environment I have a single server that has access to pretty much my entire network. That server is running Windows 2008 r2, and I have upgraded Powershell to version 4.0. The question I have is this... Can I run cmdlets from that machine on other machines that are version 4 specific? For instance, when I am using Powershell, even though it is version 4, it doesn't give me an intellisense autocomplete for "Get-Volume" like it would on a 2012 r2 machine. I understand that it won't run on that machine because the infrastructure won't allow for it, but what about a 2012 r2 machine remotely? I am looking to run batch scripts from there for various purposes.

    Read the article

  • Neglect empty cells while refreshing

    - by Ashok Vardhan
    I have an excel macro which refreshes the worksheet. However, if the file (in .csv format) with which the worksheet is being refreshed has empty cells, it's shifting the data from other columns and placing the data in wrong columns. However,if I manually refresh the sheet, it's working fine. I don't know how I can fix this. I just want my whole .csv file including empty cells to appear as it is in the worksheet. Any suggestions would be greatly helpful. The following is the Macro code. With Worksheets("RawData1").QueryTables(1) .TextFilePromptOnRefresh = False .RefreshStyle = xlinsertdelete .Connection = Application.Substitute(.Connection, CurrPath, NewPath) .Refresh End With // We can assume that we have CurrPath and NewPath properly

    Read the article

  • JQuery get attr value from ajax loaded page

    - by Paolo Rossi
    In my index.php I've a ajax pager that load a content page (paginator.php). index.php <script type='text/javascript' src='js/jquery-1.11.1.min.js'></script> <script type='text/javascript' src='js/paginator.js'></script> <script type='text/javascript' src='js/functions.js'></script> <!-- Add fancyBox --> <script type="text/javascript" src="js/jquery.fancybox.pack.js?v=2.1.5"></script> <html> <div id="content"></div> paginator.js $(function() { var pageurl = 'paginator.php'; //Initialise the table at the first run $( '#content' ).load( pageurl, { pag: 1 }, function() { //animation(); }); //Page navigation click $( document ).on( 'click', 'li.goto', function() { //Get the id of clicked li var pageNum = $( this ).attr( 'id' ); $( '#content' ).load( pageurl, { pag: pageNum }, function() { //animation(); }); }); }); /* END */ paginator.php <ul><li>..etc </ul> ... ... <a id='test' vid='123'>get the id</a> <a id='test2' url='somepage.php'>open fancybox</a> I would like to take a variable of the loaded page (paginator.php) in this way but unfortunately I can not. functions.js $(function() { $('#test' ).click(function(e) { var id = $('#test').attr('vid'); alert ("vid is " + vid); }); }); /* END */ In this case popup not appear. I tried with add fancybox in my functions.js. Dialog box appear but the url attr is not taken. var url = $('#test2').attr('url'); $('#test').fancybox({ 'href' : url, 'width' : 100, 'height' : 100, 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe', 'fitToView' : true, 'autoSize' : false }); In other scenarios, without having the page loaded, I can do it, but in this case the behavior is different. How could I do this? thanks EDIT my goal is to open a dialog (fancybox) taking a variable from the loaded page EDIT2 I tried in this way paginator.php <a id="test" vid="1234">click me</a> paginator.js //Initialise the table at the first run $( '#content' ).load( pageurl, { pag: 1 }, function() { hide_anim(); popup(); }); //Page navigation click $( document ).on( 'click', 'li.goto', function() { //Get the id of clicked li var pageNum = $( this ).attr( 'id' ); $( '#content' ).load( pageurl, { pag: pageNum }, function() { hide_anim(); popup(); }); }) function.js function popup() { $('#test' ).click(function(e) { e.preventDefault(); var vid = $('#test').attr('vid'); alert ("vid is " + vid); }); } But popup not appear...

    Read the article

  • SQL Server - Complex Dynamic Pivot columns

    - by user972255
    I have two tables "Controls" and "ControlChilds" Parent Table Structure: Create table Controls( ProjectID Varchar(20) NOT NULL, ControlID INT NOT NULL, ControlCode Varchar(2) NOT NULL, ControlPoint Decimal NULL, ControlScore Decimal NULL, ControlValue Varchar(50) ) Sample Data ProjectID | ControlID | ControlCode | ControlPoint | ControlScore | ControlValue P001 1 A 30.44 65 Invalid P001 2 C 45.30 85 Valid Child Table Structure: Create table ControlChilds( ControlID INT NOT NULL, ControlChildID INT NOT NULL, ControlChildValue Varchar(200) NULL ) Sample Data ControlID | ControlChildID | ControlChildValue 1 100 Yes 1 101 No 1 102 NA 1 103 Others 2 104 Yes 2 105 SomeValue Output should be in a single row for a given ProjectID with all its Control values first & followed by child control values (based on the ControlCode (i.e.) ControlCode_Child (1, 2, 3...) and it should look like this Also, I tried this PIVOT query and I am able to get the ChildControls table values but I dont know how to get the Controls table values. DECLARE @cols AS NVARCHAR(MAX); DECLARE @query AS NVARCHAR(MAX); select @cols = STUFF((SELECT distinct ',' + QUOTENAME(ControlCode + '_Child' + CAST(ROW_NUMBER() over(PARTITION BY ControlCode ORDER BY ControlChildID) AS Varchar(25))) FROM Controls C INNER JOIN ControlChilds CC ON C.ControlID = CC.ControlID FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)') , 1, 1, ''); SELECT @query ='SELECT * FROM ( SELECT (ControlCode + ''_Child'' + CAST(ROW_NUMBER() over(PARTITION BY ControlCode ORDER BY ControlChildID) AS Varchar(25))) As Code, ControlChildValue FROM Controls AS C INNER JOIN ControlChilds AS CC ON C.ControlID = CC.ControlID ) AS t PIVOT ( MAX(ControlChildValue) FOR Code IN( ' + @cols + ' )' + ' ) AS p ; '; execute(@query); Output I am getting: Can anyone please help me on how to get the Controls table values in front of each ControlChilds table values?

    Read the article

  • Send post data while opening SSE connection

    - by Prosto Trader
    I'm trying to establish SSE connection and do some long-taking actions on server-side, informing user about how it goes through SSE events. Actually, I don't understand how would I send some data along with new connection. I have to combine regular ajax with new EventSource or there is a way to transfer post data inside that event? Here is what I have so far, and I need to send pretty big JSON with the request. Is it possible or the only way to send data is GET? var source = new EventSource('/terminal/ajax-put-packet-trade-order/');

    Read the article

  • CSS autohide scrollbar when not scrolling on Android webpage

    - by b0Gd4N
    Is there a way to make the scrollbar auto-hide when a user is not scrolling a webpage on an Android device, but make it visible when it is scrolling? Please note that Firefox browsers does have this behaviour enabled by default, it's just Chrome and stock(Samsung, HTC) browsers that don't. This is what I currently have: -webkit-box-flex: 1; width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; And I can always see the scrollbar on the list (except in ffox)

    Read the article

  • Cuboid inside generic polyhedron

    - by DOFHandler
    I am searching for an efficient algorithm to find if a cuboid is completely inside or completely outside or (not-inside and not-outside) a generic (concave or convex) polyhedron. The polyhedron is defined by a list of 3D points and a list of facets. Each facet is defined by the subset of the contour points ordinated such as the right-hand normal points outward the solid. Any suggestion? Thank you

    Read the article

  • Change color on single-series line chart using rCharts and Highcharts?

    - by Sharon
    Is it possible to change the color of a line using rCharts and Highcharts so that the line color changes depending on a factor? I've done this with ggplot2 but would like to make an interactive version if possible. I've tried h1 <- Highcharts$new() h1$chart(type="line") h1$series(data=mydf$myvalue, name="", groups = c("myfactor")) h1$xAxis(tickInterval = 4, categories = mydf$myXaxis) but that's not working, line stays the same color. Sample data myvalue <- c(16, 18, 5, 14, 10) myXaxis <- c(1,2,3,4,5) myfactor <- c("old", "old", "old", "new", "new") mydf <- data.frame(myvalue, myXaxis, myfactor) Thanks for any suggestions.

    Read the article

  • Creating a Rails query from a hash of user input

    - by Jamie
    I'm attempting to create a fairly complex search engine for a project using a variable number of search criteria. The user input is sorted into an array of hashes. The hashes contain the following information: { :column => "", :value => "", :operator => "", # Such as: =, !=, <, >, etc. :and_or => "", # Two possible values: "and" and "or" } How can I loop through this array and use the information in these hashes to make an ActiveRecord WHERE query?

    Read the article

  • Constructing a WeakReference<T> throws COMException

    - by ChaseMedallion
    The following code: IDisposable d = ... new WeakReference<IDisposable>(d); Has started throwing the following exception on SOME machines. What could cause this? System.Runtime.InteropServices.COMException: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) EDIT: the machines that experience the error are running Windows Server 2008 R2. Windows Server 2012 and desktop machines running windows 7 work fine. (this is true, but I now think a different issue is the relevant difference... see below). EDIT: as an additional note, this occurred right after updating our codebase to Entity Framework 6.1.1.-beta1. In the above code, The IDisposable is a class which wraps an EF DbContext. EDIT: why the votes to close? EDIT: the stack trace of the failure ends at the WeakReference<T> constructor called in the above code: at System.WeakReference`1..ctor(T target, Boolean trackResurrection) // from here on down it's code we wrote/simple LINQ. None of this code has changed recently; // we just upgraded to EF6 and saw this failure start happening at Core.Data.EntityFrameworkDataContext.RegisterDependentDisposable(IDisposable child) at Core.Data.ServiceFactory.GetConstructorParameter[TService](Type parameterType) at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Core.Data.ServiceFactory.CreateService[TService]() at MVC controller action method EDIT: it turns out that the machines having issues with this were running AppDynamics. Uninstalling that seems to have removed the issue.

    Read the article

  • dynamic date formats in eyecon's Bootstrap Datepicker

    - by Jennifer Michelle
    I need to update my datepickers' date format (mm.dd.yyyy etc) using a select box. I am currently using Eyecon's Bootstrap Datepicker because it had the smallest files size that I could find (8k minified), and includes the date formats I need. I also tried to trigger date format changes in several other datepickers without any success. Fiddle: http://jsfiddle.net/Yshy7/8/ Is there an obvious way to trigger a change from the select box to the datepickers? //date format var dateFormat = $('#custom_date_format').val() || "mm/dd/yyyy"; $('#custom_date_format').change(function() { var dateFormat = $(this).val(); }); //start and end dates var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); var checkin = $('.j-start-date').datepicker({ format: dateFormat, onRender: function(date) { //return date.valueOf() < now.valueOf() ? 'disabled' : ''; } }).on('changeDate', function(ev) { if (ev.date.valueOf() > checkout.date.valueOf()) { var newDate = new Date(ev.date) newDate.setDate(newDate.getDate()); checkout.setValue(newDate); } checkin.hide(); $('.j-end-date')[0].focus(); }).data('datepicker'); var checkout = $('.j-end-date').datepicker({ format: dateFormat, onRender: function(date) { return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : ''; } }).on('changeDate', function(ev) { checkout.hide(); }).data('datepicker');

    Read the article

  • Extending rst container to output extra div attributes

    - by Manwe
    I'm starting to use pelican with reStructuredText rst page format. I have custom javascript (jQuery) things that I'd like to control with div attributes like data-default-tpl="basename" with nested content. What to extend and what. I've looked at Directives and nodes, but I just can't wrap my head around how to do it. .. rstdiv:: class1 class2 :name: namessid :extra: thisIsMyextra .. rstdiv:: nested class3 :name: nestedid :extra: data-default-tpl="basename" some text .. container:: This is normal rst container :name: contid text From rst to html with pelican. <div id="nameisid" class="class1 class2" thisIsMyextra> <div id="nestedid" class="nested class3" data-default-tpl="basename"> some text </div> </div> <div id="contid" class="container This is normal rst container"> text </div>

    Read the article

  • ASP.NET Response Filter to Reformat the rendered output of ASPX pages?

    - by PropellerHead
    I've created a simple HttpModule and response stream to reformat the rendered output of web pages (see code snippets below). In the HttpModule I set the Response.Filter to my PageStream: m_Application.Context.Response.Filter = new PageStream(m_Application.Context); In the PageStream I overwrite the Write method in order to do my reformatting of the rendered output: public override void Write(byte[] buffer, int offset, int count) { string html = System.Text.Encoding.UTF8.GetString(buffer); //Do some string resplace operations here... byte[] input = System.Text.Encoding.UTF8.GetBytes(html); m_DefaultStream.Write(input, 0, input.Length); } And this work fine when using it on simple HTML pages (.html), but when I use this method on ASPX pages (.aspx), the Write method is called several times, splitting up the reformatting into different steps, and potentially destroying the string replacement operations. How do I solve this? Is there a way to let the ASPX page NOT call Write several times, e.g. by changing its buffer size, or have I chosen the wrong approach entirely, by using this Response.Filter method to manipulate the rendered output?

    Read the article

  • How to Call a extension method from library in asp.net mvc project inside the razor view ?

    - by Anirudha
    Originally posted on: http://geekswithblogs.net/anirugu/archive/2014/06/12/how-to-call-a-extension-method-from-library-in-asp.net.aspxIf you want to call a extension method from a c# library when you are working on views then here in this post I am showing you how you can do it.   just go to views and open the web.config file. (do all these step in VWD or VS 13 whatever you use for work) inside the tag of  system.web.webPages.razor you will find the tag  namespaces which contain too many namespace which shown in intellisense when you work in Views inside your Visual studio.   now  add line like this   <add namespace="MyCustomDll" /> MyCustomDll is a namespace that came from library that I want to use in my views. Now whenever  I am working in views I can see the extension method in views.   Cheers

    Read the article

  • Logs show failed password for invalid user root from <IP Address> port 2924 ssh2

    - by Chris Hanson
    I'm getting a constant flow of these messages in my logs. The port is variable (seemingly between 1024 and 65535). I can simulate it myself by running sftp root@<my ip> I've commented out the sftp subsystem line in my sshd_config. These ports should be closed by provider's firewall. I don't understand: Why sftp would be selecting a random port like that. It seems to be behaving like FTP in passive mode, but I can't make any sense of why that would be. Why it can even hit my server in the first place if these ports are closed.

    Read the article

  • How to print out information about Task Scheduler in powershell script?

    - by Jimboy
    I am trying to print out information from the Task Scheduler from the local computer in a powershell script so other users can print out this information as well and not have to access the Task Scheduler. I need the script to print out the name, status, triggers, next run time, last run time, last run result, author and created. I can print out the information about the name, next run time, and last run time, but the rest wont print out when i run the script. I have already got a little start on my script and got the fields down. $schedule = new-object -com("Schedule.Service") $schedule.connect() $tasks = $schedule.getfolder("\").gettasks(0) $tasks | select Name,Status,Triggers,NextRunTime,LastRunTime,LastRunResult,Author,Created | ft foreach ($t in $tasks) { foreach ($a in $t.Actions) { $a.Path } } Any help or suggestions would be appreciated.

    Read the article

  • mysql cluster virtual ip

    - by user225995
    I am new in mysql cluster and mysql cluster and versions are not my choice. I setup four machines. Two of them manager , Two of them data cluster (ndb and mysqld). And i integrate with mysql utilities master/slave configuration. Everything working fine. Mysql version 5.6.17, ndb 7.3.5 , servers ubuntu 14.04. There will be no much transactions. The only important thing is HA. Everythings must be double. My problem is virtual ip. Since I have only one farm which have master slave configuration, how can i do it without proxy? If I must use proxy which proxy is better?

    Read the article

  • SQL Server 2012 Backups Not Compressing

    - by Chris
    We recently upgraded from SQL Server 2008R2 to SQL Server 2012 Enterprise. After doing this I noticed that our DB backups were barely compressing at all. Our 22gb DB was compressing down to about 4gb before upgrading to 2012 and after the upgrade our 22gb DB is only compressing down to 19gb. I've checked and double checked the compression setting on the server and all of my backup jobs and compression is turned on. Any ideas on what may be going on?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >