Search Results

Search found 1206 results on 49 pages for 'bootstrap datepicker'.

Page 42/49 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • How can I build the Boost.Python example on Ubuntu 9.10?

    - by Gatlin
    I am using Ubuntu 9.10 beta, whose repositories contain boost 1.38. I would like to build the hello-world example. I followed the instructions here (http://www.boost.org/doc/libs/1%5F40%5F0/libs/python/doc/tutorial/doc/html/python/hello.html), found the example project, and issued the "bjam" command. I have installed bjam and boost-build. I get the following output: Jamroot:18: in modules.load rule python-extension unknown in module Jamfile</usr/share/doc/libboost1.38-doc/examples/libs/python/example>. /usr/share/boost-build/build/project.jam:312: in load-jamfile /usr/share/boost-build/build/project.jam:68: in load /usr/share/boost-build/build/project.jam:170: in project.find /usr/share/boost-build/build-system.jam:248: in load /usr/share/boost-build/kernel/modules.jam:261: in import /usr/share/boost-build/kernel/bootstrap.jam:132: in boost-build /usr/share/doc/libboost1.38-doc/examples/libs/python/example/boost-build.jam:7: in module scope I do not know enough about Boost (this is an exploratory exercise for myself) to understand why the python-extension macro in the included Jamroot is not valid. I am running this example from the install directory, so I have not altered the Jamroot's use-project setting. As a side question, if I were to just willy-nilly start a project in an arbitrary directory, how would I write my jamroot?

    Read the article

  • Powershell invoke-command with PSCredential in line

    - by jaffa
    I need to be able to run a command on another server. This script acts as a bootstrap to another script which is run on the actual server. This works great on servers on the same domain, but if I need to run this script on a remote server, I need to specify credentials. The command is kicked off from a Msbuild targets file like so: <Target Name="PreDeployment" Condition="true" BeforeTargets="MSDeployPublish"> <Exec Command="powershell.exe -ExecutionPolicy Bypass invoke-command bootstrapScript.ps1 -computername $(MyServer) -argumentlist param1, param2" /> </Target> However, I need to be able to supply the credentials by creating a new PSCredentials object with a secure password for my deployment script to run on a remote server: <Target Name="PreDeployment" Condition="true" BeforeTargets="MSDeployPublish"> <Exec Command="powershell.exe -ExecutionPolicy Bypass invoke-command bootstrapScript.ps1 -computername $(MyServer) -credential New-Object System.Management.Automation.PSCredential ('admin', (convertto-securestring $(Password) -asplaintext -force)) -argumentlist param1, param2" /> </Target> When I run the build, a dialog pops up with the username set to System.Management.Automation.PSCredential. I need to be able to create the credentials in-line on the executable target. How do I accomplish this?

    Read the article

  • Launch command on remote Windows machine, given admin credentials

    - by Bilal Aslam
    I have a Windows Server 2008 instance on Amazon EC2 (Amazon's cloud compute platform, which provides VMs in the cloud). It has an external IP, and I have an admin account on the box. I would like to 'bootstrap' this instance remotely i.e. I want to run commands to download, install and configure apps on it, all without having to log on even once. I have figured out how to do this to a remote, domain-joined computer using WMI. I can even use psexec to get what I want, as long as the remote computer is part of the domain. However, I have NOT been able to do for a remote computer on EC2. Here are some specific restrictions: 1) The remote computer is not part of my domain, hence no Kerberos 2) The remote computer does not have a cert I trust, or vice versa I am sure I am running into to some auth/trust restriction. Is there any way I can run a single command on the remote, given that I have admin privileges? I'm not tied down to using WMI, but I do need to run a command somehow. Feels like this should be a solved problem.

    Read the article

  • Ruby on Rails 2.3.5: Populating my prod and devel database with data (migration or fixture?)

    - by randombits
    I need to populate my production database app with data in particular tables. This is before anyone ever even touches the application. This data would also be required in development mode as it's required for testing against. Fixtures are normally the way to go for testing data, but what's the "best practice" for Ruby on Rails to ship this data to the live database also upon db creation? ultimately this is a two part question I suppose. 1) What's the best way to load test data into my database for development, this will be roughly 1,000 items. Is it through a migration or through fixtures? The reason this is a different answer than the question below is that in development, there's certain fields in the tables that I'd like to make random. In production, these fields would all start with the same value of 0. 2) What's the best way to bootstrap a production db with live data I need in it, is this also through a migration or fixture? I think the answer is to seed as described here: http://lptf.blogspot.com/2009/09/seed-data-in-rails-234.html but I need a way to seed for development and seed for production. Also, why bother using Fixtures if seeding is available? When does one seed and when does one use fixtures?

    Read the article

  • self referencing object in JPA

    - by geoaxis
    Hello, I am trying to save a SystemUser entity in JPA. I also want to save certain things like who created the SystemUser and who last modified the system User as well. @ManyToOne(targetEntity = SystemUser.class) @JoinColumn private SystemUser userWhoCreated; @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(iso=ISO.DATE_TIME) private Date timeCreated; @ManyToOne(targetEntity = SystemUser.class) @JoinColumn private SystemUser userWhoLastModified; @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(iso=ISO.DATE_TIME) private Date timeLastModified; I also want to ensure that these values are not null when persisted. So If I use the NotNull JPA annotation, that is easily solved (along with reference to another entity) The problem description is simple, I cannot save rootuser without having rootuser in the system if I am to use a DataLoader class to persist JPA entity. Every other later user can be easily persisted with userWhoModified as the "systemuser" , but systemuser it's self cannot be added in this scheme. Is there a way so persist this first system user (I am thinking with SQL). This is a typical bootstrap (chicken or the egg) problem i suppose.

    Read the article

  • How can I format the text in a databound TextBox?

    - by Abe Miessler
    I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=""> <td> <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update" Text="Update" /> <asp:LinkButton ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" /> </td> <td> <asp:TextBox ID="FundingSource1TextBox" runat="server" Text='<%# Bind("FundingSource1") %>' /> </td> <td> <asp:TextBox ID="CashTextBox" runat="server" Text='<%# Bind("Cash") %>' /> </td> <td> <asp:TextBox ID="InKindTextBox" runat="server" Text='<%# Bind("InKind") %>' /> </td> <td> <asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>' /> </td> <td> <asp:TextBox ID="ExpectedAwardDateTextBox" runat="server" Text='<%# Bind("ExpectedAwardDate","{0:MM/dd/yyyy}) %>' onclientclick="datepicker()" /> </td> </tr> </EditItemTemplate> I would like to format the "ExpectedAwardDateTextBox" so it shows a short date time but haven't found a way to do this without going into the code behind. In the Item template I have the following line to format the date that appears in the lable: <asp:Label ID="ExpectedAwardDateLabel" runat="server" Text='<%# String.Format("{0:M/d/yyyy}",Eval("ExpectedAwardDate")) %>' /> And I would like to find a similar method to do with the insertItemTemplate.

    Read the article

  • WCF service consuming passively issued SAML token

    - by Neillyboy
    What is the best way to pass an existing SAML token from a website already authenticated via a passive STS? We have built an Identity Provider which is issuing passive claims to the website for authentication. We have this working. Now we would like to add some WCF services into the mix - calling them from the context of the already authenticated web application. Ideally we would just like to pass the SAML token on without doing anything to it (i.e. adding new claims / re-signing). All of the examples I have seen require the ActAs sts implementation - but is this really necessary? This seems a bit bloated for what we want to achieve. I would have thought a simple implementation passing the bootstrap token into the channel - using the CreateChannelActingAs or CreateChannelWithIssuedToken mechanism (and setting ChannelFactory.Credentials.SupportInteractive = false) to call the WCF service with the correct binding (what would that be?) would have been enough. We are using the Fabrikam example code as reference, but as I say, think the ActAs functionality here is overkill for what we are trying to achieve.

    Read the article

  • is it possible to turn off vdso on glibc side?

    - by heroxbd
    I am aware that passing vdso=0 to kernel can turn this feature off, and that the dynamic linker in glibc can automatic detect and use vdso feature from kernel. Here I met with this problem. There is a RHEL 5.6 box (kernel 2.6.18-238.el5) in my institution where I only have a normal user access, probably suffering from RHEL bug 673616. As I compile a toolchain of linux-headers-3.9/gcc-4.7.2/glibc-2.17/binutils-2.23 on top of it, gcc bootstrap fails in cc1 in stage2 cannnot be run Program received signal SIGSEGV, Segmentation fault. 0x00002aaaaaaca6eb in ?? () (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x00002aaaaaaabba0 0x00002aaaaaac3249 Yes (*) /home/benda/gnto/lib64/ld-linux-x86-64.so.2 0x00002aaaaacd29b0 0x00002aaaaace2480 Yes (*) /home/benda/gnto/usr/lib/libmpc.so.3 0x00002aaaaaef2cd0 0x00002aaaaaf36c08 Yes (*) /home/benda/gnto/usr/lib/libmpfr.so.4 0x00002aaaab14f280 0x00002aaaab19b658 Yes (*) /home/benda/gnto/usr/lib/libgmp.so.10 0x00002aaaab3b3060 0x00002aaaab3b3b50 Yes (*) /home/benda/gnto/lib/libdl.so.2 0x00002aaaab5b87b0 0x00002aaaab5c4bb0 Yes (*) /home/benda/gnto/usr/lib/libz.so.1 0x00002aaaab7d0e70 0x00002aaaab80f62c Yes (*) /home/benda/gnto/lib/libm.so.6 0x00002aaaaba70d40 0x00002aaaabb81aec Yes (*) /home/benda/gnto/lib/libc.so.6 (*): Shared library is missing debugging information. and a simple program #include <sys/time.h> #include <stdio.h> int main () { struct timeval tim; gettimeofday(&tim, NULL); return 0; } get segment fault in the same way if compiled against glibc-2.17 and xgcc from stage1. Both cc1 and the test program can be run on another running RHEL 5.5 (kernel 2.6.18-194.26.1.el5) with gcc-4.7.2/glibc-2.17/binutils-2.23 as normal user. I cannot simply upgrade the box to a newer RHEL version, nor could I turn VDSO off via sysctl or proc. The question is, is there a way to compile glibc so that it turns off VDSO unconditionally?

    Read the article

  • Zend_Date and Zend Locale; can't get it to work ><

    - by Rick de Graaf
    Loving Zend Framework, hating Zend_Date... I'm buidling an app where one of the functions is to track the time one spends on a certain task. This works great. My previous question was my incapability to get the sum of all the timestamps (time spent on each task). Well that works as a charm, but when I echo this value, it adds one hour. Using gmdate() (just for checking) and the value turns out exactly as it's supposed to. I thought to solve this problem easeliy with Zend_Local, but I can't get the damn thing to work! This is my bootstrap code: protected function _initLocale() { $locale = new Zend_Locale('nl_NL'); $locale->setLocale($locale); Zend_Registry::set('Zend_Locale', $locale); } This is the code in my view file: $date = new Zend_Date($this->timequery, null, $locale); echo $date->toString(Zend_Date::HOUR.':'.Zend_Date::MINUTE.':'.Zend_Date::SECOND); The timestamp I'm processing is: 2632 which equals 00:43:52. The output I get is: 01:43:52 I know the extra hour comes from the time difference, but I can seem to solve this with Zend_Local and Zend_Date.

    Read the article

  • MVC.NET custom validator is not working

    - by IvanMushketyk
    I want to write a custom validator for MVC.NET framework that checks if entered date is in the future. To do it, I wrote the following class: [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public sealed class InTheFutureAttribute : ValidationAttribute, IClientValidatable { private const string DefaultErrorMessage = "{0} should be date in the future"; public InTheFutureAttribute() : base(DefaultErrorMessage) { } public override string FormatErrorMessage(string name) { return string.Format(ErrorMessageString, name); } public override bool IsValid(object value) { DateTime time = (DateTime)value; if (time < DateTime.Now) { return false; } return true; } public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context) { var clientValidationRule = new ModelClientValidationRule() { ErrorMessage = FormatErrorMessage(metadata.GetDisplayName()), ValidationType = "wrongvalue" }; return new[] { clientValidationRule }; } } and added attribute to field that I want to check. On the View page I create input field in the following way: <div class="editor-label-search"> @Html.LabelFor(model => model.checkIn) </div> <div class="editor-field-search-date"> @Html.EditorFor(model => model.checkIn) <script type="text/javascript"> $(document).ready(function () { $('#checkIn').datepicker({ showOn: 'button', buttonImage: '/Content/images/calendar.gif', duration: 0, dateFormat: 'dd/mm/yy' }); }); </script> @Html.ValidationMessageFor(model => model.checkIn) </div> When I submit the form for the controller that requires model with checked attribute code in my validator is called and it returns false, but instead of displaying an error it just call my controller's action and send invalid model to it. Am I doing something wrong? How can I fix it? Thank you in advance.

    Read the article

  • php fuel 42000 error

    - by ryanc1256
    I don't get whats wrong. So this is the full error I get... Fuel\Core\Database_Exception [ 42000 ]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to, from, message, checked) VALUES ('1', 'freddy', 'bob', 'message', '1')' at line 1 with query: "INSERT INTO chatmes (id, to, from, message, checked) VALUES ('1', 'freddy', 'bob', 'message', '1')" and this my php code which is supposably giving me the error <?php define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR); define('APPPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/app/').DIRECTORY_SEPARATOR); define('PKGPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/packages/').DIRECTORY_SEPARATOR); define('COREPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/core/').DIRECTORY_SEPARATOR); require APPPATH.'bootstrap.php'; error_reporting(-1); ini_set('display_errors', 1); $to = $_GET['to']; $from = $_GET['from']; $message = $_GET['message']; $dquotes = '"'; $squotes = "'"; $message = str_replace($dquotes, "&quot", $message); $message = str_replace($squotes, "&#039", $message); DB::insert('chatmes')->set(array('id' => '1', 'to' => 'freddy', 'from' => 'bob', 'message' => 'message', 'checked' => '1'))->execute(); ?> I dont know what I am doing wrong?? Also the connection im using is PDO At the moment the only line thats giving me a error is, the db update query

    Read the article

  • Building a TriggerField with PopUp Window

    - by umit_alba
    Hi! I built a triggerField and when i press at it, i want to have a popup, that is appended to the button in the triggerfield(so when i click anywhere else it shall disappear and it shall pop out up to the button when i click at the button just like a datepicker-popup) I somehow managed to do something like that with an Ext.window but the offset and postion doesnt match. This all should be contained in a row editor. my Code: new Ext.grid.GridPanel({ store: Store, region:'center', height:150, //minWidth:700, autoScroll:true, listeners:{}, plugins:[new Ext.ux.grid.RowEditor()], tbar: [{ iconCls: 'icon-user-add', text: ' hinzufügen', handler: function(){ alert("abc"); } },{ ref: '../removeBtn', iconCls: 'icon-user-delete', text: 'löschen', disabled: true, handler: function(){ editor.stopEditing(); var s = grid.getSelectionModel().getSelections(); for(var i = 0, r; r = s[i]; i++){ store.remove(r); } } }], columns: [{ header: 'Monate', dataIndex: 'MONAT', width: 50, sortable: true, editor: new Ext.form.TriggerField({"id":"EditorMonate",items:[], "onTriggerClick":function(thiss){ if(!Ext.getCmp("autoWMonate")){ var monate=new Ext.Window({"x":Ext.getCmp("EditorMonate").x,closeAction:"hide",width:275,id:"autoWMonate",layout:"table",layoutConfig: {columns: 10}}); var text; for(var mon=1;mon<13;mon++){ text=mon; mon?mon:text="0"; if(mon<10) text="0"+mon; monate.items.add( new Ext.Button({cls:"x-btn",value:parseInt(text),selected:true,"text":text,id:text }}}));} } Ext.getCmp("autoWMonate").hidden?Ext.getCmp("autoWMonate").show():Ext.getCmp("autoWMonate").hide(); }}) } }] })

    Read the article

  • How to get root as '/' with Kohana3, base_url and mod rewrite.

    - by Drew
    Hi all! I've only just started using Kohana ( 3 hours ago), and so far it's blown my socks off (and I'm wearing slippers, so that's quite impressive). Right now, I have a controller 'Controller_FrontPage' with associated views and models and I'm trying to get it accesible from the root of my website (eg, http://www.mysite.com/). If I edit the default controller in the bootstrap from: Route::set('default', '(<controller>(/<action>(/<id>)))') ->defaults(array( 'controller' => 'welcome', 'action' => 'index', )); to 'controller' => '', I get an error, could not find controller_ (which makes sense), and if I change it to 'controller' => '/', I get an error, could not find controller_/ (which also makes sense). If I set 'controller' => 'FrontPage', everything works fine, but all my links (html::anchor(...)) point to http://www.mysite.com/FrontPage/*. Is there a way to have all the anchors point to http://www.mysite.com/*?

    Read the article

  • Zend_Auth and database session SaveHandler

    - by takeshin
    I have created Zend_Auth adapter implementing Zend_Auth_Adapter_Interface (similar to Pádraic's adapter) and created simple ACL plugin. Everything works fine with default session handler. So far, so good. As a next step I have created custom Session SaveHandler to persist session data in the database. My implementation is very similar to this one from parables-demo. Seems that everything is working fine. Session data are properly saved to the database, session objects are serialized, but authentication does not work when I enable this custom SaveHandler. I have debugged the authentication and all works fine up till the next request, when the authentication data are lost. I suspected, that is has something to do with the fact, that I use $adapter->write($object) instead $adapter->write($string), but the same happens with strings. I'm bootstrapping Zend_Application_Resource_Session in the first Bootstrap method, as early as possible. Does Zend_Auth need any extra configuration to persist data in the database? Why the authentity is being lost?

    Read the article

  • Get reference to all instances of jquery ui widget?

    - by Hailwood
    I am writing a jquery UI widget that simply wraps the bootstrap popover plugin, In the widget you can pass in the option 'singular', if this is passed in then it should call a function of all other instances of the plugin. something like $('#one').myWidget(); $('#two').myWidget(); $('#three').myWidget(); $('#four').myWidget(); $('#one').myWidget('show'); //stuff from widget one is now visible $('#two').myWidget('show'); //stuff from widget one and two are now visible $('#three').myWidget('show'); //stuff from widget one, two and three are now visible $('#two').myWidget('hide'); //stuff from widget one and three are now visible $('#four').myWidget('show', {singular:true}); //stuff from widget four is now visible So, I imagine the show function looking like: show: function(options){ options = options || {}; if(options.singular){ var instances = '????'; // how do I get all instances? $.each(instances, function(i, o){ o.myWidget('hide'); }); } this.element.popover('show'); } So, question being, how would I get a reference to all elements that have the myWidget widget on them?

    Read the article

  • How to set App as site.com/ in Kohana3

    - by Drew
    Hi all! I've only just started using Kohana ( 3 hours ago), and so far it's blown my socks off (and I'm wearing slippers, so that's quite impressive). Right now, I have a controller 'Controller_FrontPage' with associated views and models and I'm trying to get it accesible from the root of my website (eg, http://www.mysite.com/). If I edit the default controller in the bootstrap from: Route::set('default', '(<controller>(/<action>(/<id>)))') ->defaults(array( 'controller' => 'welcome', 'action' => 'index', )); to 'controller' => '', I get an error, could not find controller_ (which makes sense), and if I change it to 'controller' => '/', I get an error, could not find controller_/ (which also makes sense). If I set 'controller' => 'FrontPage', everything works fine, but all my links (html::anchor(...)) point to http://www.mysite.com/FrontPage/*. Is there a way to have all the anchors point to http://www.mysite.com/*?

    Read the article

  • Scala newbie vproducer/consumer attempt running out of memory

    - by Nick
    I am trying to create a producer/consumer type Scala app. The LoopControl just sends a message to the MessageReceiver continually. The MessageReceiver then delegates work to the MessageCreatorActor (whose work is to check a map for an object, and if not found create one and start it up). Each MessageActor created by this MessageCreatorActor is associated with an Id. Eventually this is where I want to do business logic. But I run out of memory after 15 minutes. Its finding the cached actors,but quickly runs out of memory. Any help is appreciated. Or any one has any good code on producers consumers doing real stuff (not just adding numbers), please post. import scala.actors.Actor import java.util.HashMap import scala.actors.Actor._ case object LoopControl case object MessageReceiver case object MessageActor case object MessageActorCreator class MessageReceiver(msg: String) extends Actor { var messageActorMap = new HashMap[String, MessageActor] val messageCreatorActor = new MessageActorCreator(null, null) def act() { messageCreatorActor.start loop { react { case MessageActor(messageId) => if (msg.length() > 0) { var messageActor = messageActorMap.get(messageId); if(messageActor == null) { messageCreatorActor ! MessageActorCreator(messageId, messageActorMap) }else { messageActor ! MessageActor } } } } } } case class MessageActorCreator(msg:String, messageActorMap: HashMap[String, MessageActor]) extends Actor { def act() { loop { react { case MessageActorCreator(messageId, messageActorMap) => if(messageId != null ) { var messageActor = new MessageActor(messageId); messageActorMap.put(messageId, messageActor) println(messageActorMap) messageActor.start messageActor ! MessageActor } } } } } class LoopControl(messageReceiver:MessageReceiver) extends Actor { var count : Int = 0; def act() { while (true) { messageReceiver ! MessageActor ("00-122-0X95-FEC0" + count) //Thread.sleep(100) count = count +1; if(count > 5) { count = 0; } } } } case class MessageActor(msg: String) extends Actor { def act() { loop { react { case MessageActor => println() println("MessageActor: Got something-> " + msg) } } } } object messages extends Application { val messageReceiver = new MessageReceiver("bootstrap") val loopControl = new LoopControl(messageReceiver) messageReceiver.start loopControl.start }

    Read the article

  • Zend_Auth and database SaveHandler

    - by takeshin
    I have created Zend_Auth adapter implementing Zend_Auth_Adapter_Interface (similar to Pádraic's adapter) and created simple ACL plugin. Everything works fine with default session handler. So far, so good. As a next step I have created custom Session SaveHandler to persist session data in the database. My implementation is very similar to this one from parables-demo. Seems that everything is working fine. Session data are properly saved to the database, session objects are serialized, but authentication does not work when I enable this custom SaveHandler. I have debugged the authentication and all works fine up till the next request, when the authentication data are lost. I suspected, that is has something to do with the fact, that I use $adapter->write($object) instead $adapter->write($string), but the same happens with strings. I'm bootstrapping Zend_Application_Resource_Session in the first Bootstrap method, as early as possible. Does Zend_Auth need any extra configuration to persist data in the database? Why the authentity is being lost?

    Read the article

  • Combining the jquery Calendar picker with the jquery validation and getting them to play nice?

    - by MBonig
    I'm just starting to get into jquery/javascript programming so this may be a beginner question but I sure can't seem to find anything about it. I have a text field on a form. I've used the JQuery UI Calendar picker to make data entry better. I've also added jquery validation to ensure that if the user enters the date by hand that it's still valid. Here is the html: <input class="datepicker" id="Log_ServiceStartTime_date" name="Log_ServiceStartTime_date" type="text" value="3/16/2010"></input> and javascript: $('form').validate(); $('#Log_ServiceStartTime_date').rules('add','required'); $('#Log_ServiceStartTime_date').rules('add','date'); the problem I'm having is this: If a user puts in a bad date, or no date at all, the validation correctly kicks in and the error description displays. However, if the user clicks on the textbox to bring up the calendar picker and selects a date, the date fills into the field but the validation does not go away. If the user clicks into the textbox and then back out, the validation correctly goes away. How can I get the calendar picker to kick off the validation routine once a date is selected? thanks

    Read the article

  • Bash script to insert code from one file at a specific location in another file?

    - by Kurtosis
    I have a fileA with a snippet of code, and I need a script to insert that snippet into fileB on the line after a specific pattern. I'm trying to make the accepted answer in this thread work, but it's not, and is not giving an error so not sure why not: sed -e '/pattern/r text2insert' filewithpattern Any suggestions? pattern (insert snippet on line after): def boot { also tried escaped pattern but no luck: def\ boot\ { def\ boot\ \{ fileA snippet: LiftRules.htmlProperties.default.set((r: Req) => new Html5Properties(r.userAgent)) fileB (Boot.scala): package bootstrap.liftweb import net.liftweb._ import util._ import Helpers._ import common._ import http._ import sitemap._ import Loc._ /** * A class that's instantiated early and run. It allows the application * to modify lift's environment */ class Boot { def boot { // where to search snippet LiftRules.addToPackages("code") // Build SiteMap val entries = List( Menu.i("Home") / "index", // the simple way to declare a menu // more complex because this menu allows anything in the // /static path to be visible Menu(Loc("Static", Link(List("static"), true, "/static/index"), "Static Content"))) // set the sitemap. Note if you don't want access control for // each page, just comment this line out. LiftRules.setSiteMap(SiteMap(entries:_*)) // Use jQuery 1.4 LiftRules.jsArtifacts = net.liftweb.http.js.jquery.JQuery14Artifacts //Show the spinny image when an Ajax call starts LiftRules.ajaxStart = Full(() => LiftRules.jsArtifacts.show("ajax-loader").cmd) // Make the spinny image go away when it ends LiftRules.ajaxEnd = Full(() => LiftRules.jsArtifacts.hide("ajax-loader").cmd) // Force the request to be UTF-8 LiftRules.early.append(_.setCharacterEncoding("UTF-8")) } }

    Read the article

  • How to prevent chrome from injecting content to webpage

    - by Nazariy
    Recently I have discovered that my application is misbehaving in Google Chrome. On a page with a form, after it was submitted, my application reloads page using simple method like this: header('Location: ' . $url); after that, page is rendered incorrectly and this content is injected to DOM <div id="sbi_camera_button" class="sbi_search" style="left: 0px; top: 0px; position: absolute; width: 29px; height: 27px; border: none; margin: 0px; padding: 0px; z-index: 2147483647; display: none; "></div> After manual page refresh everything works as expected. I'm not sure what causing this behavior, as I'm working in closed local environment and application works fine in Firefox. My application using following libraries (hosted locally): jQuery v1.7.1 jQuery UI 1.8.16 Bootstrap.js v 2.1.1 Can someone suggest me what can possibly cause this issue?

    Read the article

  • Nested Views-button aint clicking

    - by Deepika
    i have a view which has a datepicker and a button added to it. There is another view which adds the above view as subview. But the events like touchesBegan and button's action are not being clicked on the subview. Please help The code of the parent view is: iTagDatePicker *dt=[[iTagDatePicker alloc] initWithFrame:CGRectMake(0.0, 180.0, 320.0, 240.0)]; //dt.userInteractionEnabled=YES; //[dt becomeFirstResponder]; dt.backgroundColor=[UIColor clearColor]; [UIView beginAnimations:@"animation" context:nil]; [UIView setAnimationDuration:1.0]; CGPoint cntr; cntr.x=160.0; cntr.y=420.0; dt.center=cntr; [self.view addSubview:dt]; self.view.userInteractionEnabled=YES; CGPoint cntr1; cntr1.x=160.0; cntr1.y=158.0; dt.center=cntr1; [UIView commitAnimations]; [dt release]; and the code for the sub class is: - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { dtPicker=[[UIDatePicker alloc] initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, 320.0, 216.0)]; dtPicker.datePickerMode=UIDatePickerModeDate; dtPicker.date=[NSDate date]; [self addSubview:dtPicker]; btn=[[UIButton buttonWithType:UIButtonTypeDetailDisclosure]retain]; btn.frame=CGRectMake(110.0, 400.0, 100.0, 20.0); [btn setTitle:@"Done" forState:UIControlStateNormal]; btn.userInteractionEnabled=YES; [btn becomeFirstResponder]; [btn addTarget:self action:@selector(SelectedVal:) forControlEvents:UIControlEventTouchDown]; [self addSubview:btn]; } return self; } The button is not working

    Read the article

  • how to get this value on method post using asp.net mvc

    - by kumar
    I have a lable in the view <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CDC.ITT.Info.StudentBE>" %> <label for="FollowupDate"> Follow-up: <span><input type="text" id="exc-flwup" name="fdate" /></span> </label> $("input[id^='exc-flwup']").datepicker({ duration: '', showTime: true, constrainInput: true, stepMinutes: 30, stepHours: 1, altTimeField: '', time24h: true, minDate: 0 }); when I click on the input field I am getting popupcalender to select the date. My method post is <% using (Html.BeginForm("Update", "home", FormMethod.Post, new { @id = "exc-"})) { %> <%= Html.ValidationSummary(true)%> then Followupdate user is goign to select the perticular date he wants.. when this method post to the method.. public ActionResult Update(StudentBE e) { return View(); } this e should have the date value but I am not able to see the date selected there.. is there anything wrong I am doing here? thanks

    Read the article

  • Kohana 3.2 - Database Session losing data on new Page Request

    - by reado
    I've setup my dev Kohana server to use an encrypted database as the default Session type. I'm also using this in combination with Auth to implement user authentication. Right now my user's are able to authenticate correctly and the authentication keys are being stored in the session. I'm also storing additional data like the user's firstname and businessname during the login procedure. When my login function is ready to redirect the user to the user dashboard, I'm able to see all the data correctly when I do $session::instance()->as_array(); (Array ( [auth_user] => NRyk6lA8 [businessname] => Dudetown [firstname] => Matt )) As soon as I redirect the user to another page, $session::instance()->as_array(); is empty. By dumping out the Session::instance() object, I can see that the Session id's are still the same. When I look at my database table though, i dont see any session records being saved and my session table is empty. My bootstrap.php contains: Session::$default = 'database'; Cookie::$salt = 'asdfasdf'; Cookie::$expiration = 1209600; Cookie::$domain = FALSE; and my session.php config file looks like: return array( 'database' => array( 'name' => 'auth_user', 'encrypted' => TRUE, 'lifetime' => 24 * 3600, 'group' => 'default', 'table' => 'sessions', 'columns' => array( 'session_id' => 'session_id', 'last_active' => 'last_active', 'contents' => 'contents' ), 'gc' => 500, ), ); I've looked high and low for an answer.. if anyone has any suggestions, i'm all ears! Thanks!

    Read the article

  • gevent urllib is slow

    - by djay
    I've created a set of demos of a TCP server however my gevent examples are noticely slower. I'm sure must be how I compiled gevent but can't work out the problem. I'm using OSX leopard using fink compiled python 2.6 and 2.7. I've tried both the stable gevent and gevent 1.0b1 and it acts the same. The echo takes 5 seconds to respond, where the other examples take <1sec. If I remove the urllib call then the problem goes away. I put all the code in https://github.com/djay/geventechodemo To run the examples I'm using zc.buildout so to build $ python2.7 bootstrap.py $ bin/buildout To run the gevent example: $ bin/py geventecho3.py & [1] 80790 waiting for connection... $ telnet localhost 8080 Trying 127.0.0.1... ...connected from: ('127.0.0.1', 56588) Connected to localhost. Escape character is '^]'. hello echo: avast This will take 3-4 seconds to respond on my system. However the twisted example $ bin/py threadecho2.py or the twisted example $ bin/py twistedecho2.py Is less than 1s. Any idea what I'm doing wrong?

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >