Posts

Showing posts from March, 2012

javascript - YouTube iframe player API - OnStateChange 0 not firing -

as title states, i implementing video via youtube iframe api, wanting fire event once video ends. i can player events "playing" , "pausing" (1,2), not video ended (0). "an error occured" message in youtube player. adding jsfiddle's comment... any welcome, thanks! edit: this fiddle works: http://jsfiddle[.]net/nspdm/14/ note: ff did not fire because of greasemonkey script: http://userscripts.org/scripts/show/114002

ios - "No visible interface" for existing method -

this .h file: @interface test1viewcontroller : uiviewcontroller{} -(void)function1:(nsstring *)param1:(nsstring *)param2 ; @end here .m file: - (void)viewdidload{ [super viewdidload]; // additional setup after loading view, typically nib. [self function1:@"333" param2:@"sadfas"]; } -(void)function1:(nsstring *)param1:(nsstring *)param2 { } this line of code gives me error, stating: no visible @interface .... declares selector 'function1:param2 : [self function1:@"333" param2:@"sadfas" ]; i tried modify bit, not work. how fix this the function should be - (void)functionwithfirstparam:(nsstring *)param1 andsecondparam:(nsstring *)param2; param1 , param2 variables sending. thus you'll have access passed string such: - (void)functionwithfirstparam:(nsstring *)param1 andsecondparam:(nsstring *)param2 { nslog(@"param1: %@, param2: %@",param1, param2); } and you'll c

python - Turning a folder full of png icons into a PyQt4 resource? -

i have folder full of icons, 4.2 megabytes in total. every single file in folder png unique title want able access single resource file. want put them in transportable pyqt resource file, can use on various projects testing/packaging without having concern myself absolute pathnames. is there straightforward way using tools provided qt/pyqt? from understand, want generate .qrc file folder. right? i have found 2 ways accomplish this: from qtcreator, create .qrc file , when opened in editor, select add->prefix, add->files . there script here (works recursively, too). download qrcgen.py , use that: python qrcgen.py icon-folder qrc

Android (Java) Enum null pointer error -

i went out on limb , tried use enum in switch case. obviously, i'm doing wrong. here's code define enum: public class workoutstopwatch extends activity implements onclicklistener { private boolean timer_running = false; public enum counterstate { workout, rest } counterstate state; and overridden onclick method make use of it: @override public void onclick(view v) { switch(v.getid()) { case r.id.start_button: timer_running = true; // make call timer update class start break; case r.id.stop_button: timer_running = false; // make call timer update class stop break; case r.id.reset_button: if (!timer_running) { switch(state) { case workout: // todo: reset counter workout time break; case rest: // todo: reset counter

sql - Multiple database requests with one php function -

i have website in pretty regularly referencing mysql database... in couple instances have 1 large block of php code need applied multiple database requests. i have tried: $result1 = $db->query($sql1); $result2 = $db->query($sql2); function action() { ...code... } foreach($result1 $row) { action(); } foreach($result2 $row) { action(); } with code action() function execute; however, sql request not applied code. i tried placing $row variable inside action function - action($row) - did not work either. an answer problem great in helping me conserve time , code while progressing further project. of course , $row variable doesn't exist in function. need pass parameter. function action($row) { ...code... //do $row } foreach($result1 $row) { action($row); } foreach($result2 $row) { action($row); }

javascript - Replacment infoBox to jquery dialog modal window -

here have map, markers , infoboxes. now want change infoboxes jquery dialog() , modal window... how can that? here code infobox google.maps.event.addlistener(marker,'click',function(){ service.getdetails(request, function(place, status) { if (status == google.maps.places.placesservicestatus.ok) { var contentstr = '<div class="m_tooltip"><h5>'+place.name+'</h5><p>'+place.formatted_address+'</p>'; if (!!place.formatted_phone_number) contentstr += '<br>'+place.formatted_phone_number; if (!!place.website) contentstr += '<br><a target="_blank" href="'+place.website+'">'+place.website+'</a>'; if (!!place.photos) contentstr += '<img src='+place.photos[0].geturl({ 'maxwidth': 300, 'maxheight': 300 })+'></img>'; conte

Spring Integration : Publish Subscribe channel. Is it asynchronous? -

i using publish-subscribe channel after inbound gateway receives string message parallely send logger log message , transformer transform message. want both these acivities happen in parallel. my question simple - publish subscribe channel in spring integration sends messages it's subscibers parallely? below code snippet source of spring-integration-context.xml. <int:gateway id="gateway" service-interface="com.test.gateway"> </int:gateway> <int:publish-subscribe-channel id="publishsubscribechannel" /> <int:service-activator input-channel="publishsubscribechannel" method="transformevent" ref="transformer" output-channel="transformerreplychannel"> </int:service-activator> <int:service-activator input-channel="publishsubscribechannel" method="logmessage" ref="logger"> </int:service-activator> here transformer , l

java - Specifying custom screen resolution in Selenium tests -

in below blog mentioned, can modify screen resolution during selenium test runs. http://blog.testingbot.com/2013/03/15/screen-resolution-option-now-available-for-all-selenium-tests i have tried below code(as mentioned in " https://saucelabs.com/docs/additional-config "), not setting specified resolution. still not available selenium? please me. desiredcapabilities dc=new desiredcapabilities(); dc.setcapability("screen-resolution","1280x1024"); sauce labs != selenium sauce labs use capability provision vm desired resolution, it's not capability selenium knows about. selenium not capable of modifying desktop resolution! if want modify browser size in selenium matches specific resolution can a: driver.manage().window().setsize(new dimension(1024, 768)) the above not supported opera driver, instead need do: desiredcapabilities capabilities = desiredcapabilities.opera() capabilities.setcapability("opera.arguments"

ibm mobilefirst - How to get the userIdentity of the user being logged out when using Worklight adapter based authentication -

i implementing adapter based authentication worklight application. record, using worklight version 5.0.6.1. what is, seems advised in documentation, perform cleanup in "logout" function of authentication adapter. thus, inside logout function being called automatically worklight framework, i'd retrieve useridentity object holding info user being logged out. tried achieve calling "wl.server.getactiveuser()", not seem possible in logout function. i can see following exception in logs (websphere app server 7): [9/3/13 17:13:11:683 ist] 00000039 dataaccessser 1 com.worklight.integration.services.impl.dataaccessserviceimpl invokeprocedureinternal procedure 'onlogout' invocation failed. runtime: adapter 'onlogout' security test has no user realm.java.lang.runtimeexception: adapter 'onlogout' security test has no user realm. the idea behind want call external rest service perform cleanup in db, , need mobile application useri

Kendo UI Mobile Drawer with MVC View structure -

is there way use kendo ui (mobile) drawer navigation in main _layout views , have mobilelistview items link different mvc views instead of mobileviews listed on 1 page? thanks! i've been working quite while (both asp.net mvc helpers , javascript library), , i've arrived @ conclusion it's hassle work mvc. also, newly released asp.net mvc helpers don't work satisfactory yet, have few bugs , kinks in regards ui , navigating between links. let me know if find solution this!

angularjs - How to detect when angular is in its digest loop -

i have angularjs app shows message box when detects more number of rows have been returned in web service call. unfortunately, however, angular appears go digest loop when call service, , message box displayed 3 times. i don't care angular needs internally, provided it's not way have coded function. however, don't want message box shown (nor web service called) 3 times. examining call stack each time function below called, can see call not originate application code. how can detect state of loop can ignore calls after first one? function bindresults(expression) { var maxrows = 100; listdata.search(expression, maxrows).then(function (data) { $scope.searchresults = data; if (data.length == maxrows) { var title = "search warning"; var msg = "the maximum number of cases returned, try being more specific"; var btns = [{ result: 'ok', label

javascript - Get UI button clicked on CK Editor toolbar -

i have built simple plugin ck editor (because apparently that's way add custom button toolbar?) i'd know how can dom id of custom button when clicked (or object representative of button allow me create jquery object) (function () { ckeditor.plugins.add('myplugin', { icons: 'myicon', hidpi: true, init: function (editor) { editor.addcommand('mycommand', { exec : function(editor) { // button information } }); editor.ui.addbutton && editor.ui.addbutton('mycommand', { label: 'custom action', command: 'mycommand', toolbar: 'insert,5', icon: 'myicon' }); } }); })(); i'd attach own custom ui element toolbar when button clicked , need relative anchor point in order display in correct position on sc

android - Music(activity) restarts when rotating device...why does it happen?and how can i stop it from restarting? -

well think question describes , anyways here code public class nowplaying extends activity implements serializable { static mediaplayer mp =new mediaplayer(); string artist;progressdialog pd; int position; string key=null ; /*int z=0; seekbar songprogressbar ; textview songcurrentdurationlabel; textview songtotaldurationlabel ; private handler mhandler = new handler(); private utilities utils=new utilities(); */ @suppresslint("newapi") protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.now_playing); intent = getintent(); position=i.getintextra("data2", 0); /* songprogressbar = (seekbar) findviewbyid(r.id.songprogressbar); songcurrentdurationlabel = (textview) findviewbyid(r.id.songcurrentdurationlabel); songtotaldurationlabel = (textview) findviewbyid(r.id.songtotaldurationlabel);

c# - Windows Store App loading library at runtime xaml error -

i'm loading library windows store app through reflection (activator.createinstance), when initializecomponent() page class being loaded dynamically called exception of "unspecified error". there no dots in assembly name loaded , i've placed xaml in correct place specified uri in code behind. i'm using visual studio update 3. have searched extensively internet , haven't clues what's problem. strange thing noticed after loadcomponent() called debugger goes through xamltypeinfo.g.cs code of main assembly , not 1 of assembly being loaded, may that's problem. thanks this happens because winrt xaml needs xamlmetadataprovider autogenerated , resides in dynamically loaded assembly in case. explanation see: http://www.sharpgis.net/post/2013/05/30/decoding-the-ixamlmetadataprovider-interface-part-1.aspx

vba - In Access 2010 how would I find all of the null fields in my table and replace them with user supplied data? -

i have access 2010 database going import data excel sheet , append data proper table. issue having once imported, data not have customer id attached cust_id field in table null. need macro ask user customer each import , find customer's id , put value of null fields. have made lot of different attempts @ (mostly though macro builder don't know start vba this) none of have shown results. think latest 1 close reason isn't running after import. have "after insert" macro, , idea prompt user [customer name] look-up custid tbl_customers insert each of null fields. unfortunately after import data nothing happens , i'm not sure why. parameters name: customer name record in tbl_customers condition =[tbl_customers].[fld_customer_name]=[customer name] alias custname record in tbl_customers condition =[tbl_customers].[fld_customer_pk_id]=[custname] alias custid each record in tbl_contacts condition =isnull([fld_contact_fk_customer_id]) editrecord set

c++ - Create a linked list using base a class and a derived class -

how can create linked list using base class , derived class eg.: class base { int id; base *next; }; class derived : public base { string name; }; base *list = null; base *b = new base(); b->next = list; list = b; derived *d = new derived(); d->next = list; list = d; base *itr = list; while(itr) { if(typeid(base) == typeid(*itr)) { cout << "base: " << itr->id << endl; } else { cout << "derived: " << itr->id << " , " << itr->name << endl; } itr = itr->next; } my approach not work! suggestions? what want works fine. see complete example: #include <stdio.h> #include <typeinfo> struct base { base *next; int id; base(int id) : id(id) {} virtual ~base() {} }; struct derived : base { int id2; derived(int id, int id2) : base(id), id2(id2) {} }; void link(base *n, base **list) { n->next =

php - Change URLs with .htaccess -

i have website i'm trying change urls on. of urls start http://domain.com/ ? for example, http://domain.com/?index i want remove question mark. don't care if appears in address bar, want users able access pages on site without having type question marks. so, if user wants access http://domain.com/?index , want them able access typing http://domain.com/index . is possible using .htaccess? i've searched around , tried few different things few days , still can't figure out way accomplish i'm trying do. any appreciated. thanks. try: rewriteengine on # match against request instead of uri rewritecond %{the_request} ^[a-z]{3,9}\ /\?([^&\ ]+)&?([^\ ]*) rewriterule ^$ /%1?%2 [l,r=301] this takes uri's http://example.com/?path/to/file.txt , redirects browser http://example.com/path/to/file.txt . browser display url in location bar instead. is, of course, assuming if actually goes url , there there served other 404. edit to i

asp.net - Redirect .aspx webpage using MVC routing -

i have asp.ne web forms application, in have asp.net mvc area (with razor view engine) i have aspx page @ location project/pages/email.aspx somehow either crawl agents or users, able request http://wwww.mydomain.com/pages/email.aspx?param1=2&param2=3 i want redirect such request " pagenotfound " below not options: remove page: since aspx page used in application other purposes. not interested redirect on pagelod event (correct me if best way of doing it.) interested know if possible way: handle though asp.net mvc area (which part of web forms app) routeconfiguration? isapi web.config / global.asax note: has 301 permanent redirect. you can in web.config following this: https://stackoverflow.com/a/10400010/412451 in case like <configuration> <location path="email.aspx"> <system.webserver> <httpredirect enabled="true" destination="http://domain.com/pagenotfound.aspx" http

python 2.7 - QGraphicsScene crashes PyQt4 -

windows xp python 2.7 pyqt 4 when run following code inside python interactive shell from pyqt4 import qtgui qtgui.qgraphicsscene() python crashes. why? you need create qapplication first before can use of qt gui elements. it's done this: from pyqt4 import qtgui import sys qapp = qtgui.qapplication(sys.argv) scene = qtgui.qgraphicsscene() ... qapp.exec_()

oracle11g - Need help understanding why this sql is needed in Oracle? -

i'm assigned fill in role of dba (temporary). i'm developer, i'm not capable of many knowledges in oracle... today, while monitoring activities, see following sql being performed developer's work station (toad.exe). auto generated toad somehow or query being manually written? reason is, i'm concerned individual have privilege select sys schema. i've consulted developer, , says not query sys tables nor have need. i'm bit concerned how query generated. any advice appreciate it. thanks! select index_name "index name", index_type "index type", uniqueness "uniqueness", status "status", table_owner || '.' || table_name "table", table_type "table type", tablespace_name "tablespace", buffer_pool "buffer pool", initcap (partitioned) "partitioned", decode (temporary, 'n', 'no', 'y

How can I set the log output level for Chef on Amazon OpsWorks? -

my question similar to: how can display output of opscode chef bash command in console? i want able see console output running recipe. in particular, recipe failed start jboss because java_home not being set. took me entire day figure out because statement java_home undefined not being printed chef output. when running chef solo, debugging output can turned on appending -l debug command, in: chef-solo -c solo.rb -j node.json -l debug however, when using amazon opsworks, there no such option: sudo opsworks-agent-cli run_command [activity] [date] [/path/to/valid/json.file] how can add log level run_command ? try running: cd /opt/aws/opsworks/current bundle exec chef-solo -l debug -c conf/solo.rb -j /var/lib/aws/opsworks/chef/xxx.json

.htaccess - Apache redirect to a port and mask the URL -

i have 1 web server running 2 sites on different ports. ie: server:8081 , server:8083 setup 2 dns records , pointed “my server” dev.server.com , pre.server.com i dev.server.com redirect server:8083 mask url stay dev.server.com , pre.server.com redirect server:8081 mask url stay pre.server.com if set them this <virtualhost *:80> servername http:// dev.server.com proxyrequests off proxypass / http://server:8083 proxypassreverse / http://server:8083 </virtualhost> <virtualhost *:80> servername http:// pre.server.com proxyrequests off proxypass / http://server:8081 proxypassreverse / http://server:8081 </virtualhost> everything routes dev instance , nothing makes pre instance i have set this; <virtualhost *:80> servername http:// dev.server.com rewriteengine on rewritecond %{http_host} ^dev\.server\.com$ [nc] rewriterule ^(.*)$ http:// dev.server.com:8083$1 [r] rewritecond %{http_host} ^pre\.server\.com$ [nc] rewriterule ^(.*)$ http://pre.

Javascript - Dynamic object keys (second key) -

i can create dynamic object follows: var year=2103; var month=9; var selected={}; selected[year][month]=true; but following gives undefined object error presume because first key has not been created , javascript not automatically doing that. selected[year]=true; but following gives undefined object error presume because first key has not been created , javascript not automatically doing that. yes, have create it: var year = 2103; var month = 9; var selected = {}; selected[year] = {}; selected[year][month] = true; if you're unsure if object exists, , not want overwrite it: selected[year] = selected[year] || {}; as shortcut populate object if missing & assign month key in 1 step: (selected[year]||(selected[year]={}))[month] = true;

javascript - Validationwith two-way dat-bind in jsViews -

trying find out elegant way handle validation client side on two-way data bound property in jsviews template. example reference, please @ pi documentation jsviews two-way binding @ jsview's api link here: http://www.jsviews.com/#jsvplaying . i want validate "name" when updating property before view updated new value. examples/guidance/ideas highly appreciated! thanks, there number of samples on jsviews.com show 1 approach validation. a jsviews "validate" tag contro l generic edit control - base class validate control datepicker validation datepicker validation (wizard) (how use validation group control in association stepping through wizard. happens use datepicker in example)

playframework - Dynamic content in the root template in Play framework (Scala) -

i learning play framework & wondering how create dynamic sidebar/footer appear in root template & wouldn't need pass data explicitly when rendering every single view. read through the docs , , there nothing this. in django create custom template tag this. there similar in play well? best / typical approach solve this? how avoid passing parameters everywhere in play2? , http://jazzy.id.au/default/2012/10/26/passing_common_state_to_templates_in_play_framework.html quite helpful. for example can have templates footer.scala.html, main.scala.html , header.scala.html. main.scala.html can like: @(title: string)(content: html)(implicit x: sometype) <!doctype html> <html> <head> <title>@title</title> <link rel="stylesheet" media="screen" href="@routes.assets.at("stylesheets/main.css")"> <link rel="shortcut icon" type="image/png" href

mysql - How to get random rows including one specific id row -

i have query, select * different tables != $this->player_id -> works fine. and looks following: $sql = " select pi . * , p . * player_img pi, player p pi.player_img_category_id = $this->category_id , pi.player_img_player_id = p.player_id , pi.player_img_player_id != $this->player_id"; what want bit different: select random results , order limit 10 inbetween random results one specific row needs there - row should based on $this->player_id to random results, guess can like: order rand() limit 10 -however how make sure specific row included: pi.player_img_player_id == $this->player_id - have no idea on. suggestions? edit: allinone's answer im looking do- bonus question im wondering if possible sort query results asc p.player_firstname example?? how using union 2 queries different conditions select q.* ( select pi . * , p . * player_img pi, player p pi.player_img_category_id = $this-&g

c++ - Implicitly convert from std::string to eastl::string -

i using string class stl std::string want replace eastl . easy question: eastl::string obj = std::string("test"); error: conversion ‘the::string {aka std::basic_string}’ non-scalar type ‘eastl::string {aka eastl::basic_string}’ requested is possible automate conversion between types? no, not if eastl::string not define copy constructor/assignment operator std::string . the simplest way go std::string eastl::string use .c_str() method pointer std::string 's internal char array std::string ss("hello"); eastl::string es = ss.c_str(); you can add own if want modify library. although bad idea simple example: class mystring { private: char *str; public: mystring(const std::string &s) { str = new char[s.length() + 1]; /* allocate */ strcpy(this->str, s.c_str()); /* copy */ } ~mystring() { delete [] str; } }; then can create new mystr

Decreasing height of bootstrap 3.0 navbar -

Image
i trying decrease bootstrap 3.0 navbar height used fixed top behavior. here using code. html <div class="tnav"> <div class="navbar navbar-fixed-top" role="banner"> <div class="navbar-inner-sm"> <div class="container"> <div class="navbar-header"> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <nav class="collapse navbar-collapse" role="navigation"> <ul class="nav navbar-nav pull-right"> <li class="active">

javascript - HTML anchor tag in an iframe -

i have weird issue in chrome (only in chrome). i have page std layout (header,content,footer left , right margin). content section has iframe containing many anchor tags of form <a href="#" onclick="dosomething()">text</a> when of anchor tag clicked, header goes hidden. anchor tag of same form outside iframe works fine. i have verified dom has header elements intact. display not 'none' (zooming in page 150%, header starts appearing slightly). when force browser redraw page, changing css attribute(height) of content section , header appears. when change href '#' '#nonexistent', link works fine. one quick fix change href to, javascript:void(null); (and works too) or equivalent. i'm somehow constrained can't add scriptlets. looks weird. can help/point me right direction? try changing/adding target attribute anchor tags in iframe. i'm not whether header disappearing within iframe or parent page, g

.net - Printing Image in C#, colors more opaque than printing from OS -

Image
i'm trying print jpg image winforms application, need colors close original image resulting colors more opaque comparing them image printed os (from windows photo viewer or word). this code: private void printdocument1_printpage(object sender, system.drawing.printing.printpageeventargs e) { e.graphics.pageunit = graphicsunit.pixel; e.graphics.smoothingmode = system.drawing.drawing2d.smoothingmode.highquality; e.graphics.pixeloffsetmode = system.drawing.drawing2d.pixeloffsetmode.highquality; e.graphics.interpolationmode = system.drawing.drawing2d.interpolationmode.highqualitybicubic; //e.graphics.textrenderinghint = system.drawing.text.textrenderinghint.antialiasgridfit; e.graphics.compositingquality = system.drawing.drawing2d.compositingquality.gammacorrected; e.graphics.compositingmode = system.drawing.drawing2d.compositingmode.sourcecopy; var img = image.fromfile(@"c:\photo.jpg", true);

android use java vs linux -

is there advantage/disadvantage of executing linux command in android app rather using java alternative? ex: file file = new file("file.txt"); file.delete(); vs rm file.txt advantages? none, really, or @ least not in general case. i see being useful if want invoke separate , complex program doesn't expose programmatic interface. in case i'd still go invoking via processbuilder rather using system execution. disadvantages unsafe if it's not program, don't know does. may tampered with, , may require using different permissions , privileges. unstable if it's not program, don't know if it's there , if be. wasteful it spawns process no reason. opaque it's harder monitor long-running task , check return codes (and again conventions these may change in future, brings unsafe , unstable ).

Communicate between android Application and java -

every body new in program world , getting issue,my request related communication between android tablet desktop pc using java code. import java.io.ioexception; import java.io.printwriter; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; public class helloworldservlet extends httpservlet { private static final long serialversionuid = 1l; public helloworldservlet() { super(); } protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { printwriter out = response.getwriter(); out.println("hello android !!!!"); } } above code servlet code running in local system server (tomcat 6.0 ) here sending message through println , want reveive same message in android app running in system. going post android code running on system. import

javascript - Is it possible to get the points in a third party Google Map? -

i'd latitude/longitude of points in map did not create (e.g. this one ). possible information using google maps api directly? know specific example can find markers object in page , fetch data i'd rather not rely on html parsing. that link provided not google maps api application. shared map via google maps - has nothing javascript api. if see end of url you'll see parameter &output=embed . remove url , should take original map created on google maps itself, in here can export points via kml download link.

jquery - How to respond with coffee script -

how can respond coffee flavoured js? def new respond_with { |format| format.js } end # new.js.coffee.erb $('#blah_' + @blah.id).something -> etc... this breaks, though: missing template . need choose between coffee or erb , want both. if suffix template .js.coffee you'll both erb , coffeescript capabilities. this highly confusing because templates define pre-processors want templates run through adding extensions. see issue on github: https://github.com/rails/coffee-rails/issues/36

javascript - Dynamically setting image in underscore template -

i'm using underscore templates render html list displays list of contacts. the template looks this: <li> <span class="name">name: <=%data.name%></span> <span class="email">name: <=%data.email%></span> <img class="avatar" src="<=%data.avatar%>"></img> </li> the issue is, when set template data, source of image won't known. why? because data looks this: contact = { name: string, // i.e. 'john doe' email: string, // i.e 'john@doe.com' avatar: string // i.e. '11a93150-14d4-11e3' } the avatar not url, rather link remote database needs fetching. like: function getavatar(uuid, cb) { // uuid 11a93150-14d4-11e3 window.db.getimageurl(function(url) { cb(url); // url http://foo.com/avatar.png }); } question is, there way write template instead of reading avatar value of contact object directly, can embed reference function getavata

asp.net - C# - HttpClient is not sending any cookies -

i developing 2 websites names www.web1.com , www.web2.com. in web1 saving http cookie below httpcookie authcookie = new httpcookie(appconstants.cookie.auth_cookie); authcookie.path = "/"; authcookie.value = "value1"; response.cookies.add(authcookie); now want read cookie in second website i.e. web2. trying read using httpclient below httpclienthandler handler = new httpclienthandler(); handler.cookiecontainer = new cookiecontainer(); httpclient client = new httpclient(handler); response = client.getasync("http://www.web1.com").result; var cookies = cookies.getcookies(new uri("http://www.web1.com")); this doesn't returns cookies, checked via fiddler well. if directly open www.web1.com , check fiddler sends cookie. please see missing cookie not returned httpclient. thanks, sb not sure if work in case authcookie.domain = "ip/domain"; should job you. having said there other alternatives query stri

html - Bootstrap fully 100% height with a sidebar -

Image
i can not understand why height of sidebar on right, not 100%, , when scroll down page, background interrupted. <nav id="nav" class="nav-primary hidden-xs nav-vertical"> <ul class="nav affix-top" data-spy="affix" data-offset-top="50"> <li><a href=""><i class="icon-user"></i> Профиль</a></li> <li><a href=""><i class="icon-bar-chart"></i> Финансы</a></li> <li><a href=""><i class="icon-sitemap"></i> Товары</a></li> <li><a href=""><i class="icon-signal"></i> Товары (статистика)</a></li> <li><a href=""><i class="icon-envelope-alt"></i> Уведомления (10)</a></li> </ul> </nav> life example here a couple things. you have 2 po

Image drops to right before fade on Chrome using bg switcher jquery -

i'm using bg switcher jquery in project i'm facing issue on chrome. the code i'm using is: $(document).ready(function(){ $(".wrapper").bgswitcher({ images: ["img/1.jpg", "img/2.jpg", "img/3.jpg"], // background images effect: "fade", // fade, blind, clip, slide, drop, hide interval: 5000, // interval of switching loop: false, // loop switching shuffle: false, // shuffle order of images duration: 800, // effect duration easing: "swing", // effect easing position: "center top" }); }); someone know how fix it?

Go web server does not process /delete/ pattern correctly -

i played google go official example writing web applications tried add functionality delete pages , has not worked. reason if pass "/delete/" parameter http.handlefunc() function 404 page not found. other "foobar" string works expected. simplified code: package main import ( "fmt" "net/http" ) func handler(w http.responsewriter, r *http.request) { fmt.fprintf(w, "%s", r.url.path) } func main() { http.handlefunc("/hello/", handler) //http.handlefunc("/delete/", handler) http.listenandserve(":8080", nil) } steps reproduce: compile , call http://localhost:8080/hello/world browser output /hello/world now comment http.handlefunc("/hello/", handler) , uncomment http.handlefunc("/delete/", handler) compile , call http://localhost:8080/delete/world browser result 404 page not found , expected /delete/world question: there special meaning &qu

boost - any decent graph libraries for C++? -

i wish generate graph date on x axis , price on y, there decent libraries out there me accomplish little overhead? thanks in advance i qwt, not low overhead. maybe gplot, give more info contaxt perharps. http://qwt.sourceforge.net/ http://gplot.sourceforge.net/

pdf - PHP force download, not sending full binary files -

Image
i'm creating protected file download system e-commerce website. using php authenticate user logged in , owns product before downloaded. using example provided php.net manual have run error serving both pdf , png files. it has worked @ 1 point, during development. we've gone live, seems have broke... fortunately website not running full-force @ moment it's not huge issue right now. what happening: you visit download url. verified owner of product, , download starts. appears normal, reviewing headers looks ok. header states content length "229542" (224.16kb), looks ok. the problem: when download completes, file size 222 bytes . there no errors displayed, , no php errors/warnings/notices being sent in file or browser. it's if php being terminated, without warnings. if turn debugging on, don't see warnings. the source file looks this (in notepad++, it's pdf it's binary) when downloaded, looks this (only 7 lines, compared 2554)

pandas - How to read a large text file in Python? -

i using enthought canopy (a set of many different python library packages e.g. numpy, pandas,etc) data analysis. trying read text file , create dataframe out of it. text file has 1180598 rows , 18 columns. columns have numbers in them. wrote following code reading , naming data columns: from pandas import dataframe, read_csv import matplotlib.pyplot plt import pandas pd print 'pandas version ' + pd.__version__ pandas version 0.12.0 location=r'c:\umair\directed studies\us-101 data\main data\us-101-main-data\vehicle-trajectory-data\0750am-0805am\tra.txt' df=read_csv(location, names=['vehicle id','frame id','total frames','global time','local x','local y','global x','global y','vehicle length','vehicle width','vehicle class','vehicle velocity','vehicle acceleration','lane identification','preceding vehicle','following vehicle','spaci

c# - Using Dependency Properties With Multiple Instances -

i have same problem guy here: error: " 'subjects' property registered 'period' " raised when more 1 control placed on form the main difference between want subscribe event has access local instance when xaml changes property. so have usercontrol: public partial class boardsquare : usercontrol { public boardsquare() { initializecomponent(); location = new boardlocation(int32.minvalue, int32.minvalue); xpositionproperty = dependencyproperty.register("xposition", typeof(int), typeof(boardsquare), new propertymetadata( new propertychangedcallback((value, args) => { location.x = (int)args.newvalue; resetbackgroundcolortoposition(); }))); ypositionproperty= dependencyproperty.register("yposition", typeof(int), typeof(boardsquare), new propertymetadata

java - run web application - error: package javax.faces.bean does not exist -

i'm newly @ web application. tried run easy web application program. after running javac -d web-inf/classes web-inf/classes/bigjava/*.java i had output: nazar_art@nazar-desctop:~/desktop/big java/bj4_code/ch24/time$ javac -d web-inf/classes web-inf/classes/bigjava/*.java web-inf/classes/bigjava/timebean.java:6: error: package javax.faces.bean not exist import javax.faces.bean.managedbean; ^ web-inf/classes/bigjava/timebean.java:7: error: package javax.faces.bean not exist import javax.faces.bean.sessionscoped; ^ web-inf/classes/bigjava/timebean.java:9: error: cannot find symbol @managedbean ^ symbol: class managedbean web-inf/classes/bigjava/timebean.java:10: error: cannot find symbol @sessionscoped ^ symbol: class sessionscoped 4 errors code: package bigjava; import java.text.dateformat; import java.util.date; import java.util.timezone; import javax.faces.bean.managedbean; import javax.faces.bean.sessionscoped; @

sql server - How to get data from date 15th to 15th -

i have table of user's input times follows : table name timebilling : fields : timebillingid int userid int starttime datetime stoptime datetime elapsedtime time(7) normaltime time(7) overtime time(7) now want report in want calculate total times of users. total elapsedtime, total normaltime , total overtime month. but month 15th 15th. want results should : user month totaltime normaltime overtime 1 march-april 120:58:00 100:58:00 20:00:00 2 march-april 97:40:23 97:40:23 00:00:00 1 april-may 15:00:00 14:30:00 00:30:00 2 april-may 89:30:00 80:15:00 09:15:00 i using query working month month : select month(tym.stoptime) month, year(tym.stoptime) year, u.userid, isnull((select cast(sum(datediff(second,0,t.elapsedtime))/3600 varchar(20)) + ':' + right('0' + cast(sum(datediff(second,0,t.elaps