Posts

Showing posts from February, 2012

javascript - Is it possible to create "anchor points" for an image, in another image? -

i'll preface question asserting i'm no "web guy". have little no experience programming in javascript, or other web-based programming technology aside xml , related xslt; go easy on me! what suppose i'm trying create akin imagemap: place image on webpage then, based on information i've received hardware chassis, populate various "hardware slots" in image of chassis image of piece of hardware in location. i'd create these points , have them relative image, not browser window, create image of chassis anywhere , still place images of cards on appropriate slots. is there mechanism using vars hold offsets, , placing other images, using var offsets relative chassis image? there different way sort of thing? i agree thiefmaster, , sketch markup this. <div class="chassi"> <div id="slot1" class="slot"></div> <div id="slot2" class="slot"></div> ...

Using Javascript to connect SQL Server database -

i need use javascript read data sql server 2008 database. wrote this:(html page code) <!doctype html "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>database connect</title> <script type="text/javascript"> function loaddb(){ var connection = new activexobject("adodb.connection"); var connectionstring="data source=ИЛЬЯ-ПК;initial catalog=c:\program files\microsoft sql server\mssql10.mssqlserver\mssql\data\sigma_database.mdf;user id=Илья;password="";provider=sqloledb"; connection.open(connectionstring); var rs = new activexobject("adodb.recordset"); rs.open("select username users", connection); rs.movefirst(); while(!rs.eof) { document.write(rs.fields(1)); rs....

How to remove menu in Drupal? -

taxonomy menu created 2 menus, have not gone after disabled it. if go : admin/build/menu-customize/navigation there 1 menu "company category" many submenues. when click edit takes me to: admin/build/menu/item/738/edit . here save button found. how can delete it? taxonomy menus generated automatically , can configured in taxonomy vocabulary settings. you can disable taxonomy menu here: administer › content management › taxonomy › (choose related vocabulary) › edit vocabulary › taxonomy menu › menu location: = disabled =

iphone - How to insert characters from a Keyboard-accessoryView right? -

i'm presenting bar additional keys above on-screen keyboard ( accessoryview ). i'm inserting pressed characters uitextfield using replacecharactersinrange:withstring: , saving , restoring selectedrange , temporarily disabling scrollenabled . ugly solution + undo/redo not working. can better? there api handling custom keys? not sure intricacies of handling special characters, uitextinput protocol looking for. check out: http://developer.apple.com/library/ios/#documentation/uikit/reference/uitextinput_protocol/reference/reference.html

python - problem in executable created with py2exe -

i have application written in python uses pygtk built gui, glade files included window building. my problem application works fine when run cmd, when create exe py2exe application doesn't start, creates empty log file writing in application logs. my setup.py looks : from distutils.core import setup import os import pygtk import py2exe setup( name = 'abc', description = 'blah blah blah', author = 'xyz', version = '0.1', windows = [ { 'script': 'filename.py', 'icon_resources': [(1, "logo.ico")], } ], options = { 'py2exe': { 'packages':'encodings', 'includes': 'cairo, pango, pangocairo, atk, gobject,gio', } }, data_files=[ 'logo.png', 'bg.png', 'completed.png', 'down.png',...

javascript - Fullcalendar editable property not working? -

here code $(document).ready(function() { $('#calendar').fullcalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,basicweek,basicday' }, dayclick: function() { alert('nemke'); }, events: function(start, end, callback) { $.ajax({ url: 'usercalendarservice.asmx/getevents', type: 'post', datatype: 'xml', data: {start: + math.round(start.gettime() / 1000),end: + math.round(end.gettime() / 1000)}, success: function(result) { var events = []; $(result).find('event').each(function() { events.push({ title: $(this).find('title').text(), start: $(this).find('start...

php - Parse a multilevel array to view-file -

i need parse multilevel array view file. my array this: $test = array( 1 => array( 10 => array('text' => 'test'), 15 => array( 12 => array('text' => 'test') ), 'text' => 'nr. 1' ), 4 => array( 14 => array('text' => 'hello'), 'text' => 'nr. 4' ) ) this passed view file, this: {test} {text} {/test} my problem is, show first level - want have unlimited levels.. possible without making workaround, create html in php-file , passes html view file? it sounds need bit of recursion. function recurse_output($input, $level = 0) { foreach($input $key => $value) { echo "\n", str_repeat(" ", $level); echo "<div>{$key} is: "; if(is_array($value)) recurse_output($value, $level + 1); else e...

How do I get a shortname for a folder in WiX for a Windows Installer property? -

i trying register out-of-process com file (.exe) through wix after extracting com registration regspy.exe, , running problem registry key need write is: <registryvalue value="c:\progra~1\common~1\file.exe /automation" type="string" /> now use windows installer property [commonfilesfolder] not installs c:\ for in-process (.dll) long name acceptable: <registryvalue value="[commonfilesfolder]file.dll" type="string" /> but appears in not true out-of-process. there way convince or convert [commonfilesfolder] short name? particular problem x64, name resolve c:\progra~2\ instead of c:\progra~1\ use [!idoffile] full short path. (see formatted in msi sdk full list of special formatting keys.)

zend framework - How can I setup View helpers in the views directory? -

i want setup helpers directory under views , place view helpers there. i have setup test view helper in application/my/app/view/helper/ i declared class so: class my_app_view_helper_test extends zend_view_helper_abstract i setup the bootstrap.php file so: $view->sethelperpath(application_path.'/my/app/view/helper','my_app_view_helper'); this working perfectly. learned zendcasts. cannot set way want to. how set helpers in views/helpers/ ? rules regarding directory naming conversion? use plural , use capitalization when naming directories? i thank in advance help. sincerely, complete noob you can have helper named application_view_helper_myhelper in application/views/helpers . in bootstrap should have following: $view->sethelperpath(application_path.'/views/helpers','application_view_helper'); here, register new plugin prefix view helpers - application_view_helper , point zend framework classes prefix in following pat...

java - Spinner onItemSelected() executes when it is not suppose to -

possible duplicate: android spinner onitemselected called erroneously (without user action on opening spinner) does know how prevent onitemselected() (onitemselectedlistener interface) method running when layout instantiated? need know if there way because want keep how instantiate layout separate listener. i have tried creating if statement set false around code inside of overridden method, there no way of knowing when set true because overridden method runs after oncreate(), onstart(), , onresume() methods everytime. i have not found clear cut answers on this. clear cut solutions appreciated. david, here tutorial wrote problem... problem statement an undesirable onitemselected() triggered whilst gallery (or spinner) initializing. means code prematurely executed; code intended execute when user physically makes selection. solution in oncreate(), count how many gallery (or spinner) widgets have in view. (mgallerycount) in onitemselected(), coun...

java - Log4j has no support for binary logging format? -

i have need have log4j log binary format logs can machine-interpreted. know use xml purpose don't want associated file size bloat or parsing overhead. the whole layout system seems inherently string based, means can't use nice file-rolling appenders. loggingevent serializable, i'm thinking of writing binary file appender myself, feel shouldn't treading new ground here. am missing obvious? there nothing in log4j distribution. you have @ http://sourceforge.net/projects/bclf/ end writing own appender , implement doappend(logginevent).

Jquery dialog close by clicking link -

i'm new use jquery ui. i'd create modal dialog box , close when click on link or image within modal box. i found way hide close button,but don't know how set popup close on click or add image link inside box. can provide me full code obtain this? if @ documentation ( http://docs.jquery.com/ui/dialog#methods ) can see there close function. when creating dialog can attach click event arbitrary element (a new close link/image/button/anything) calls close function on dialog object: var my_dialog = $('#my_div').dialog({});//options, etc $('#my_div .my_close_link').click(function () { my_dialog.close(); });

Including -lib command line parameters in ant build.xml -

i have build script requires -lib command line switch so: ant -lib lib/jsch-20101122.jar .... this works fine, i'd include command line argument part of build.xml file , make build cleaner. i'd prefer not include jar in ant_home/bin directory. is there way it? i assume, want use scp-task (http://ant.apache.org/manual/tasks/scp.html) the official doc (http://ant.apache.org/manual/install.html#optionaltasks) optional tasks offers no real alternative (you may want @ classpath alternative, though). the scp-task not seem have classpath setting.

websocket - Protovis force re-render -

i know protovis isn't meant used way, there workaround destroying what's in pv.panel , re- add() 'ing , re- render() 'ing panel? i'm working on visualization built static , trying migrate being updated periodically via websockets. yes can have protovis re-render without destroying panel. can update data used panel, , call render on again. example: var data = [1, 2, 3]; var panel = new pv.panel() .data(data) .add(pv.bar) ... panel.render(); // initial render data = [4, 5, 6]; panel.data(data); // update data panel.render(); // re-render

sql - CREATE DATABASE permission denied in database 'master'. MVC EF 4.1 Codefirst getting started -

i checked here , internet no answer. how work ? using discountasp.net sql setting on thier side make work ? the following blog post explains well. if haven't specified connection string in web.config ef codefirst attempt create db on local instance of sqlexpress. otherwise can set intent assigning named connnection string via public constructor of entities context inheriting base constructor. http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-2-connections-and-models.aspx public class unicornscontext : dbcontext { public unicornscontext() : base("unicornscedatabase") { } } either way you'll need ensure account has appropriate access sql(express) server create new database.

ruby on rails - NoMethodError when I push a object into a Doc with mongoid -

i'm having problem, tried lot of differents aproachs everytime falls in error. enviroment: rails 3.0.5 mongoid 2.0.1 class user include mongoid::document field :name has_and_belongs_to_many :companies end class company include mongoid::document field :name has_and_belongs_to_many :users end in usercontroller method create this: @user = user.where(:email => params[:user][:email]) if @user.count > 0 @user.companies.push(@company) @user.save @company.users.push(@user) @company.save else @user = user.create(:name => params[:user][:name], :email => params[:user][:email], :password => "123456") @user.companies.push(@company) @user.save @company.users.push(@user) @company.save end when user dont exist works great. but if user in db, fall error. nomethoderror in usercontroller#create undefined method `companies' #<array:0x10679f638>...

date - joining data based on a moving time window in R -

i have weather data recorded every hour, , location data (x,y) recorded every 4 hours. want know temperature @ location x,y. weather data isn't @ same time. so, have written loop every location scan through weather data looking "closest" in date/time , extracting data time. problem way ive written it, location #2, scans through weather data not allow closest time information assigned assigned location#1. location #1 & 2 taken within 10 minutes @ 6pm , 6:10pm, closest weather time 6pm. can't allow weather data @ 6pm option. kind of set because 200 locations location data set (say 3 months it), not want starting @ time 0 weather data, when know closest weather data calculated last location , happens 3 months data set too. below sample data , code. don't know if makes sense. <h6>####location data</h6> <p>x y datetime <br /> 1 2 4/2/2003 18:01:01 3 2 4/4/2003 17:01:33 2 3 4/6/2003 16:03:07 5 6 4...

javascript - onclick print destination url -

i have link on our invoices page. the link, points print friendly url printing invoice. the issue is, "onclick" print content of url. not sure if dooable without opening destination url first. ? link: ( first method doesnt work because prints current url ) <li class="print"><a href="https://www.mysite.com.au/pdf/invoice_parse.html?id=<?=$r['invoice'];?>" onclick="window.print();return false">print invoice</a></li> essentially, want onclick of link, print destination url. without leaving page. suggestions please when use window.print() , prints current window. open iframe , call window.print() inside of it. you away hiding iframe giving position: absolute; left: -9999px . javascript assuming these links match on protocol, domain , host . var printinvoice = function(url) { var iframe = document.createelement('iframe'), iframedocument; iframe.style.post...

dictionary - Key Order in Python Dictionaries -

code: d = {'a': 0, 'b': 1, 'c': 2} l = d.keys() print l this prints ['a', 'c', 'b']. i'm unsure of how method keys determines order of keywords within l . however, i'd able retrive keywords in "proper" order. proper order of course create list ['a', 'b', 'c']. you use ordereddict (requires python 2.7) or higher. also, note ordereddict({'a': 1, 'b':2, 'c':3}) won't work since dict create {...} has forgotten order of elements. instead, want use ordereddict([('a', 1), ('b', 2), ('c', 3)]) . as mentioned in documentation, versions lower python 2.7, can use this recipe.

cocos2d iphone - playEffect] problem with effect -

hi trying make car engine sound using simpleaudioengine . i can use engine on menu loop without problem works fine [[simpleaudioengine sharedengine] playbackgroundmusic:@"menuloop.wav"]; but cannot use of playeffect metods [[simpleaudioengine sharedengine] playeffect:@"engine.wav"]; [[simpleaudioengine sharedengine] playeffect:@"engine.wav" pitch:0.5f pan:0.6f gain:1.0f]; both of them dont working on simulator or device plz me out... make sure wave file using format supported cocosdenshion. explained here: http://www.cocos2d-iphone.org/wiki/doku.php/cocosdenshion:faq#i_ve_got_some_wave_files_but_they_don_t_work_what_can_i_do you can try using afconvert tool fix file: afconvert -v -f wave -d lei16 notworking.wav working.wav

javascript - data is not sent to php from ajax -

hi in code below want send email (with input data user, in case email address) php file but $email = $_post['email']; <<<<<<<<<<<< retrieve nothing in php file js file <script type="text/javascript"> $(document).ready(function() { $("#form").submit(function() { $.ajax({ url: "data.php", type: "post", datatype: "json", data: { email: $('#email').val()}, success: function(data) { if () { //something } else { //something } } }); return false; }); }); </script> any reason that? i tested email="oneprivateemail" in php , validation correct, problem email not sent js file. correct?...

myisam - MySQL Full-Text search vs Like %% -

what key differences , use case both of them? thanks! full-text search kind of search based on special sort of index (full-text, obviously). power of o(lgn) while searching using it. while like %% always causes table fullscan can terrible slow (when have 100k , more rows). personally use like %% when small table (0-1000 rows) , i'm sure never grow (and, important, when like %% fits task requirements). note: fulltext indexes available myisam se. if use innodb - need @ 3rd party indexing software sphinx

Python HTML parsing with beautiful soup and filtering stop words -

i parsing out specific information website file. right program have looks @ webpage, , find right html tag , parses out right contents. want further filter these "results". for example, on site : http://allrecipes.com/recipe/slow-cooker-pork-chops-ii/detail.aspx i parsing out ingredients located in < div class="ingredients"...> tag. parser job nicely want further process these results. when run parser, removes numbers, symbols, commas, , slash(\ or /) leaves text. when run on website results like: cup olive oil cup chicken broth cloves garlic minced tablespoon paprika now want further process removing stop words "cup", "cloves", "minced", "tablesoon" among others. how do this? code written in python , not @ it, , using parser information can manually enter rather not. any on how in detail appreciated! code below: how this? code: import urllib2 import beautifulsoup def main(): url = "http://...

Installing RVM on Ubuntu 10.10 error -

i'm trying this: bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) but keep getting error bash: line 1: html: no such file or directory bash: line 2: syntax error near unexpected token `<' 'ash: line 2: `<head><title>301 moved permanently</title></head> what's going on? the url install rvm changed use https, command now: \curl -l https://get.rvm.io | bash -s stable however, should read up-to-date rvm installation docs current command.

javascript - smooth transition between pages when redirecting with jquery -

i trying smooth transition when redirect users. first fading out page redirecting , and fadein. here redirect if ( data.redirect != undefined ) { $("#toppanel").slideup(1000); $("#content").fadeout(2000, function() { window.location = data.redirect; }); my next page has javascript in header this: jquery(function ($) { $("div.container_16").first().hide(); $(".grid_16").first().hide(); $("div.container_16").first().fadein(2000); $(".grid_16").first().slidedown(4000); this work except few milli sec second page loads turns blank , fades in. how fix this? need change css or html? a simple fix be: css body{ display:none; } js jquery(function ($) { $('body').show(); $("div.container_16").first().hide(); $(".grid_16").first().hide(); $("div.container_16").first().fadein(2000); $(".grid...

jquery - Javascript library to manipulate (drag/resize/rotate) objects -

what's javascript library or jquery plugin allows move objects, resize them (preferably @ least 4 handles), rotate them, etc? http://threedubmedia.com/code/event/drag/demo/ has things, there other solutions out there? in advance! jquery ui has awesome drag/drop , resizing methods... drag/drop: http://jqueryui.com/demos/draggable/ resize: http://jqueryui.com/demos/resizable/ not sure rotate.. check , :) found nice rotate plugin: http://code.google.com/p/jquery-rotate/ hope of :)

sql server - query to display a row data as column -

i need query execute record of row columns, eg: row holds data '101,102,103,104' . result should be: 101 102 103 104 you can check switching-rows-and-columns-in-sql

c# - How can I directly execute SQL queries in linq -

in c# vs 2008,i have query ,in query join more 1 tables,so don't know type , want know how directly run sql query in linq . ienumerable<type> results = db.executequery<type>("sql query") my above query works fine want avoid type, want write var results = db.executequery("sql query"); is there way write it? thanks in advance. you need specify type map query results. can use system.type object instead of statically specifying generic type parameter: var results = db.executequery(typeof(customer), "sql query "); if want plain ado.net datareader use datacontext.connection property: using (var cmd = db.connection.createcommand()) { cmd.commandtext = "sql query "; var results = cmd.executereader(); }

android - how to add scroll button on list view? -

i have seen 1 think in android list view there 1 small button on right side scrolling list. astro provide right side button scrolling list , visible while scrolling list , invisible when ideal. i dont have idea how done this. m thinking there 1 property enable this. please provide ans if use that. thanks in advance! i find ans can enable bye following propery og listview in xml android:fastscrollenabled="true"

cryptography - What's an Elmer Cipher -

what's elmer cipher? can find reference on cipher algorithm? i'm going guess supposed el gamal . fits rest of description (i.e., it's asymmetric/public-key cipher).

javascript - IE8 window size problem -

i'm using javascript code : function openquerywindow(val) { var wname = "...."; var srcheight = screen.height - 100; var srcweight = screen.width - 100; var dleft = 50 var dtop=25 var sfile="....."; window.open(sfile,wname,"scrollbars=1,location=0,status=0,menubar=0,toolbar=0,directories=0,resizable=0,width=" + srcweight + ",height=" + srcheight + ",top="+dtop+",left="+dleft+",alwaysraised") } this code works in pop-up window in ie7 doesn't work in ie8 , pop-up window seems uncontrollable! how solve this? you can force ie8 render html ie7 does... add in close opening tag possible <meta http-equiv="x-ua-compatible" content="ie=7" /> here full article

c - Print out a selected number of a string problem -

the exercise says "make function 2 parameters string (s) , integer(n). function return first n characters. that's did, i'm getting compiler error "[warning] passing arg 1 of `symbolse' makes pointer integer without cast". i've tried changes, override error don't result want or program crashes. #include<stdio.h> #include<stdlib.h> void symbolse(char s[50],int n){ int i; for(i=0;i<n;i++) printf("%c ",s[i]); } main(){ int m; char a[50]; printf("give integer: "); scanf("%d",&m); printf("give string: "); a[50]=getchar(); symbolse(a[50],m); system("pause"); } ex. user gives m=3 , a[50]=house . program should print hou . one problem a[50]=getchar() . reads 1 character 50-th position in buffer (which way out of a 's bounds). trying using scanf instead. symbolse(a[50],m) wrong. i'll let figure out problem is. one ...

c# - i have a project where i need to make special routing how i can make my own rule? -

in own site need thing page known #topic. it's need mywebsite.com#google [are possible need pass google parameter] or mywebsite.com/#google [if first can not done how can use it] how can apply thing in website. thing need done if open site mywebsite.com#google content genrate dynamically through [passing google parameter] can show how can make routing you can't use routing this. value follows # sign in url never sent server client browser. example if request http://example.com/someaction#google server can never fetch value google because browser never sends it. way use javascript ( window.location.hash ) , maybe send ajax request server rewriting url : http://example.com/someaction?param=google

mysql - You can't specify target table 'A' for update in FROM clause -

this request > delete id in ( select > id left join b on a.id=b.id > b.id null ) when execute have error you can't specify target table 'a' update in clause maybe instead? delete id not in (select distinct b.id b);

matlab - Convert an exponential matrix into number matrix -

i have matrix, say: corr_a1=[6 2.150000e+003 0 1.175000e+003 3.250000e+000 4.500000e+001] i want convert said values decimal format, i.e. a=[6.00 2150.00 1175.00 3.25 45.00] how do this? check format .

c# - WPF ProgressBar doesn't update? -

i trying update progressbar using data bindings. xaml file contains progressbar: <progressbar height="23" name="progressbar" verticalalignment="bottom" margin="207,444,0,0" minimum="0" maximum="{binding progressbarmax}" value="{binding progressbarvalue}" /> my relevant c# class contains getter & setter: private int progressbarmax; public int progressbarmax { { if (this.progressbarmax == 0) this.progressbarmax = 1; return this.progressbarmax; } set { this.progressbarmax = value; } } private int progressbarvalue; public int progressbarvalue { { return progressbarvalue; } set { progressbarvalue = value; } } in "update" method maximum being set. example this.progressbarmax = 100...

javascript - window.open(url, name, features) under IE -

this regarding javascript method window.open(url, name, features) . if url relative or under same domain of current page, parameter features ignored ie. example: http://statcomp.ats.ucla.edu/webtools/javatools/popup.htm . this happens in ie8/9 @ least. why? there workaround? thanks lot, xiao the time use px client side web thing in css. that should be: height=400,width=400 .

ios - error while setting image in imageView in iphone -

i have written code setting imageview ...as per button clicked...but problem when press button giving me error like...too many arguments function imagenamed...while executing line... uiimage* photo = [uiimage imagenamed:@"robort %d.jpg",x]; the whole code is.... -(void)buttonclicked:(uibutton*)button { nslog(@"%d",button.tag); int x; x=button.tag; // create image view. uiimage* photo = [uiimage imagenamed:@"robort %d.jpg",x]; nslog(@"%d",x); cgsize photosize = [photo size]; uiimageview *imageview = [[uiimageview alloc] initwithframe:cgrectmake(0.0, 0.0, photosize.width, photosize.height)]; [imageview setimage:photo]; [self.view addsubview:imageview]; } use uiimage* photo = [uiimage imagenamed:[nsstring stringwithformat:@"robort de nero%d.jpg",x]]; cheers :)

Packaging fonts in visual studio deployment package and the zip folder structure -

i'm using msbuild create deployment package part of build process. calling msbuild /t:package part of command. this working great except 2 things. i using web fonts , seems these not being included part of package (they included in project). how include these fonts? the folder structure within zip file ludicrous - includes full path drive letter down. anticipate cause problems length of path names @ point. know how prevent this? (i know it's duplicate of this: visual studio deployment package - change file structure .zip creates? ) the reason fonts (or other non-standard file) not being deployed "build action" set "none". fix this, select file in solution explorer , modify build action "content". package project , included. i never understood folder structure either. using msdeploy publish site uses folder structure deploy multiple sites @ once. it's annoying when looking @ package "work". also... max file lengt...

c++ - Extracting the "n"th image out of a bmp (or other image type) -

i have bmp image that's comprised of 13 images, , each image 17x17. aside breaking image down through gimp 13 different images, way 'extract' nth image list (into char array, preferably) may use it? i've tried advancing pointer forward n*17*17 pixels, , aside fact ignores header, thought should work - unfortunately, doesn't. suggestions? note i've tagged c and c++ because i'm happy see/hear of solution in either language. perhaps use existing tools tile cropping convert paged.gif +gravity -crop 32x32 tiles_%d.gif imagemagick comes api usable many language, including c, c++, php, perl, etc etc relevant function seem be cropimagetotiles

c# - Exception Assistant not working -

i'm using vs2010 wpf, c#, cli , native c++. when exception in c# part, don't see exception assistant. it seems exception assistant not working, if unmanaged code debugging enabled. as need both, there workaround problem? in tools/options have checked "enable exception assistant". in project settings have checked "enable unmanaged code debugging". if uncheck "enable unmanaged code debugging" exception assistant working excepted. whenever see because vs has decided disable "thrown" option "break when exception is" options under debug->exceptions menu item. i've had happen multiple times, though haven't been able isolate why yet. when re-enabling on "thrown" options leave "common language runtime exceptions" unchecked if application mix of c#/c++.

Consuming HTTPS web service using WCF -

i'm trying consuming client's web service using wcf. client's web service done on https, , can consume fine following binding: <bindings> <basichttpbinding> <binding name="purchaseordersoap" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="strongwildcard" maxbuffersize="65536" maxbufferpoolsize="524288" maxreceivedmessagesize="65536" messageencoding="text" textencoding="utf-8" transfermode="buffered" usedefaultwebproxy="true"> <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384" /> ...

actionscript 3 - When to use ContainerMovieClip and when to use UIMovieClip? -

i using flex flash builder 4 , provides 2 classes work custom flash professional components, containermovieclip , uimovieclip. i confused on when use containermovieclip , when use uimovieclip. since containermovieclip can hold 1 component, don't see how better placing component directly on design area. i have thought of using inner frame arrange multiple components can moved modifying x,y coordinates of container, understand isn't how works, right? i'd appriciate if answer or direct me article on 1) when use uimovieclip , when use containermovieclip? 2) why containermovieclip can hold single component? thanks. raamee adobe's docs useful , 90% of time answer questions. http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/mx/flash/uimovieclip.html http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/mx/flash/containermovieclip.html

asp.net mvc 3 - IValidatableObject and Nullable value types -

i have struct implements ivalidatableobject, use properties on view model. validation works fine non-nullable properties, if add property of type nullable <mystruct > ivalidatableobject.validate method never called property, if has value. is there way trigger validation on nullable properties too, or ivalidatableobject not intended used value types? thanks additional information: i wanted able specify units when entering data in form, e.g. 10m, 100km, 1cm etc. wanted validate entered data within range , of correct format. struct converts string potentially different units (100cm/100m/1km) decimal property has same unit (1/100/1000) , vice-versa. i used ivalidatableobject validation because validation same instance of mystruct - didn't want add attribute each time used. my model this: public class mymodel { public mystruct ab {get; set;} public mystruct? cd {get; set;} } my view typed view using model, renders struct text box using display tem...

css - Change behaviour of placeholder attribtute -

the placeholder element got introduced html5 great sadly dislike implementation, when click in field suggestion text gone. i'd different in way if empty should show placeholder text if focused or not. show placeholder except if text in box. i using jquery implementation utalizes okay to.

javascript - Generate PDF when clicking on a link -

my problem statement is, i have set of links in webpage,which created in javascript. now want if clicks link should go corresponding page , pdf file should generate automatically. in ubuntu os there option generate pdf of page, how use generate automatically, if need condition also. it server side task generate pdf or whatever. while javascript client side technique (in case). so need use server side technology. should let know language use: php, c#, ruby, python etc. suggest ready out of box library.

objective c - iOS: How to dynamically change DetailView in SplitView template? -

i've got splitview template project. want change detailview on user selecting item in rootviewcontroller. in fact can't change what's inside view (detailview) it's done in template (when check "use core data storage" on creating project). want switch between whole views. i've tried that: appdelegate *appdelegate = [uiapplication sharedapplication].delegate; [appdelegate.detailviewcontroller setview:curretndetailviewcontroller.view]; appdelegate.detailviewcontroller = currentdetailviewcontroller; by way don't understand why need line#2 (..setview:..)? why assigning detailviewcontroller (line#3) not enough? - code looks awful=( but anyway doesn't work want. except detailview disappears. i've changed main view, not detailviewcontroller's i guess should change in splitviewcontroller didn't find out what=( thanks attention. i had questions week ago , got little in forum. hope can change you. first did know apple...

objective c - error: libxml/parser.h: No such file or directory -

i'm attempting use xml (chapter 10 in professional iphone , ipad database application programming ), , i've run bit of trouble. under header search paths in build settings have path: /developer/platforms/iphoneos.platform/developer/sdks/iphoneos4.3.sdk/usr/include/libxml2/ that's fine , well, then: #import <libxml/parser.h> #import <libxml/tree.h> error: libxml/parser.h: no such file or directory if flip imports: #import <libxml/tree.h> #import <libxml/parser.h> error: libxml/tree.h: no such file or directory weird. for have this: #import <libxml/catalog.h> // dirty hack #import <libxml/parser.h> #import <libxml/tree.h> error: libxml/catalog.h: no such file or directory but that's no production app. try changing header search path ${sdk_dir}/usr/include/libxml2 .

xml - Parsing HTML in Delphi to find the addresses of all images -

how can extract addresses of images in html file using delphi, example using html parser? you can use ihtmldocument2 interface parse html, check sample retrieving image links html document

typeclass - Question about type classes in Scala -

let there classes fruit , orange , , apple . abstract class fruit class orange extends fruit class apple extends fruit now want add write functionality both types orange , apple . using type class pattern can following: trait writer[t] {def write(t:t)} implicit object applewriter extends writer[apple] { def write(a:apple) {println("i apple!")} } implicit object orangewriter extends writer[orange] { def write(o:orange) {println("i orange!")} } def write[t](t:t)(implicit w:writer[t]){w.write(t)} so for, if want define writefruits ? def writefruits(fruits:list[fruit]) {for (fruit <- fruits) write(fruit)} i writefruits call either write[apple] or write[orange] each fruit . see not work (and know why) maybe can implement writefruits anyway. can implement writefruits somehow ? you need pick out fruit writer exists. unfortunately, once you've cast fruit you've lost ability automatically figure out which. if mu...

javascript - php setcookie not working with ajax call -

i have page, test.php, following code: <html> <body> <form> <script type="text/javascript"> function sendcookies(){ if (window.xmlhttprequest)/* code ie7+, firefox, chrome, opera, safari */ { xmlhttp=new xmlhttprequest(); } else /* code ie6, ie5 */ { xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status == 200) { alert('done'); } } xmlhttp.open("get", "/web/dev/classes/setcookie.php?time=" + new date()); xmlhttp.send(); } </script> <input type="tex...

html - Selecting adjacent and previous siblings in CSS -

say instance have following html <ul> <li><a href="a">a</a></li> <li><a href="b">b</a></li> <li class="myclass"><a href="c">c</a></li> <li><a href="d">d</a></li> <li><a href="e">e</a></li> </ul> now can detemine next sibling li class="myclass" using following css .someclass + li {}. if wanted apply css rule previous li, possible using css rather jquery's $("#some-id").prevall() or writing javascript find this? i'm not confident i've never heard of , searching hasn't provided solution. thanks nope, in css can't 'traverse' dom structure. can inherit style definitions recursively.

Front controller object in zend framewok -

what diff. between below objects of front controller , how use it? $this->bootstrap('frontcontroller'); $frontcontroller = $this->getresource('frontcontroller'); $front = zend_controller_front::getinstance(); what diff. between these 2 objects of front controller? both $frontcontroller = $this->getresource('frontcontroller'); and $front = zend_controller_front::getinstance(); will return same instance of zend_controller_front. singleton, definition there can 1 instance of object. difference when execute $this->bootstrap('frontcontroller'); you insuring bootstrap has executed front controller resource, zend_application_resource_frontcontroller default. imo, use first example in bootstraps , resources, use latter everywhere else. both same instance of front controller, benefit first example lets bootstrap know front controller dependency.

Result id from database by mysql? -

i have column in database saved id 1,12,10 , want return 1 id 1 or 12 or 10 when use return wrong data? can do? you can use limit . select col table_name limit 1 this return 1 result. however claiming returning wrong results, can't if don't post more. update as per comment, want use in select col table_name id in (10, 12, 1)

hidden - Hide echo from apt-get in python -

how can hide process of installing java (apt-get openjdk-6-jre) when it's runned in python? can replace "installing java..." till it's ready. thanks in advance. here's implementation of @khachik's comment: import os subprocess import stdout, check_call check_call(['apt-get', 'install', 'openjdk-6-jre'], stdout=open(os.devnull,'wb'), stderr=stdout) it raises exception in case of error.

java - Swing - how to handle multiple cross-dependent components? -

this more general question: have quite complicated files table in swing (the data model not trivial) , , when when user clicks on entry , 2 other view components need change - file statistics view , , file content view - both on same screen. one options have these components class definitions in same file , , have reference each other - make messy code. the other option think of pass statistics , content components table object , , have him use - render table not - reusable anywhere else. i'm sure there's better way - recommend do? option 1: class mypanel extends jpanel{ private mytable table; private myfileviewer fv; private myfilestats stats; class mytable { addmouselistener({ ... fv.update(); stats.update(); }) } class myfileviewer{...} class myfilestats{...} } options 2: class mytable { mytable(myfileviewer fv, myfilestats stats) { ... addmouselistener({fv.update, stats.update ... } } } option 3: model–view–controller pa...

sql - Read column values to variable in SSIS using for each loop -

i want read resultset of table using following stmt: select col1 a,col2 b tablename; then, want read each row of result set local variables of ssis package , each row have pass values script task. i want use foreach loop in ssis. took foreach item enumerator. the question: how read values variable using each item enumerator , how can iterator can use select count(*) table ; pass value variable , asssign count value in foreach loop. i'm stuck @ how assign count value , read columns variables. can these? thanks in advance. i'm not sure you're trying do, seem you're trying process data in control flow. foreach iterator not made processing data sets, it's made iterating on multiple data sets , doing each of them, passing them data flow. you might find more useful create data flow. start data source component gets data want , pass data script component processing.

HTML/CSS IE Not displaying my dropdown menu z-index related -

for reason cannot display dropdown menu on ie when add z-index in header of number. when remove it, works. dropdown appears behind container , content in firefox , chrome. either take out or leave in, cant seem satisfy browsers. tried making separate ie stylesheet without z-index doesnt work either. know separate ie css working because changed backgrounds uses dropdown menu in master stylesheet. website www.stingrayimages.ca thank edit: lets got work on ie since ie gives problems. dropdown menu appears behind content on other browsers firefox , chrome. did remove z-index in #head div. anyway fix dropdown menu without adding z-index head div? edit: got dropdown work on ie9 firefox , chrome. not ie 6, blew up. #head { position:relative; height: 140px; width: 100%; background: #fff; filter:alpha(opacity=93); padding-top:20px; /* css3 standard */ opacity:0.93; -moz-box-shadow: 0 0 5px black; -webkit-box-shadow: 0 0 5px black; ...

python - How to write Big files into Blobstore using experimental API? -

i have dilemma.. i'm uploading files both in scribd store , blobstore using tipfy framework. have webform action not created blobstore.create_upload_url (i'm using url_for('myhandler')). did because if i'm using blobstore handler post response parsed , cannot use normal python-scribd api upload file scribd store. have working scribd saver: class uploadscribdhandler(requesthandler, blobstoreuploadmixin): def post(self): uploaded_file = self.request.files.get('upload_file') fname = uploaded_file.filename.strip() try: self.post_to_scribd(uploaded_file, fname) except exception, e: # ... exception message , msg = e.message # ... # reset stream 0 (beginning) file can read again uploaded_file.seek(0) #removed try-except see debug info in browser window # create file file_name = files.blobstore.create(_blobinfo_uploaded_filename=fname) ...

c# - How to call function from specific referenced DLL -

i need call specific function castle.core.dll seems though automapper , moq have castle.core merged assemblies. this need call castle.dynamicproxy.generators.attributestoavoidreplicating.add(typeof(system.security.permissions.uipermissionattribute)); but ambiguous reference because castle.core technically available in 3 locations (automapper, moq, , standalone dll) i can't un-ref of dlls because managed nuget , castle.core standalone needed nhib , other dlls pulled in automapper , moq nuget packages. any suggestions? other not depending on nuget managing library refs? you try using extern aliases. can find property on assembly references. look @ question detail: what use aliases property of assembly references in visual studio 8

Using XMPP with iPhone SDK? -

i looking ebook or online tutorial building chat application iphone sdk / xmpp server. using xmppframework. any guide or appreciated. the xmppframework has tutorial iphone: https://github.com/robbiehanson/xmppframework/wiki/gettingstarted_ios

perl - Regex - match up to next match -

i iterate matches on text, blocks want match start number tab character. my beginning match ^\d+\t , there way indicate want text including match until next match? input data: 1 111.111.111.111 111.111.111.111 host ip 111.111.111.111 111.111.111.111 111.111.111.111 host ip tcp app 11111, 11111, 11111, 11111 allow 2 111.111.111.111 111.111.111.111 111.111.111.111 host ip 111.111.111.111 111.111.111.111 host ip tcp app 11111, 11111, 11111, 11111 allow 3 111.111.111.111 111.111.111.111 host ip 111.111.111.111 111.111.111.111 111.111.111.111 111.111.111.111 host ip tcp app 11111, 11111, 11111, 11111 allow 4 111.111.111.111 111.111.111.111 111.111.111.111 111.111.111.111 host ip 111.111.111.111 111.111.111.111 host ip tcp app 11111, 11111, 11111, 11111 allow i'...

database - .NET - A fast lightweight persistent key-value storage -

i'm looking persistent key-value storage .net. requirements are: storage used objects identified strings , have several optional (named) properties values byte arrays. sql solution model 1 string -> id table, , several id -> blob tables. the expected amount of data several megabytes (more 10 mb unlikely, scaling 100 mb nice bonus) lightweight - preferably single-assembly, without external applications reads more frequent writes, @ least factor of 100. fast read/write access - expect in-memory storage , lazy writes on updates data; can periodically spawn async writes myself, bonus points if storage it. atomic i/o - database should not break if process terminated in middle of writing; otherwise data not critical, i.e. no additional redundancy needed. currently think sqlite work here; seems slight overkill - need key-value storage, not full sql support. i've heard of bdb, , of libdb-dotnet binding - seems more lightweight, don't know performance/consistenc...

multithreading - equality test for atomic variables in C and gcc -

i have dummy question atomic variables using gcc. machine supports __sync_add_and_fetch function; use call in thread set my_variable (int) . i want thread b reading shared variable test against value e.g. 20. correct write following if( __sync_bool_compare_and_swap( &my_variable, 20, 20 ) ){ //..ok! 20 go ahead! }else{ // wrong: not ok. } if not wrong in gcc __sync_val_compare_and_swap might fail when there race in shared variable, don't know return; how work __sync_bool_compare_and_swap ? problem happens when @ same time thread changing value using __sync_fetch_and_add ? guaranteed return value of sum event when __sync_bool_compare_and_swap running concurrently? ideally speaking , purpose, need function doing atomic read only, nor swap. has c or gcc this? thanks lot afg as far atomic operations go, meant complete without interruption. if have multiple atomic operations expect run concurrently, there race condition con...

jquery - Lightbox analog for HTML data -

i need analog of lightbox html loaded via ajax. , should work in ie6 :) i believe there bunch of plugins. prefer crossbrowser , easiest in setting. share expirience, please! i'll store them here, our children (i'll add more comments): http://fancybox.net/ (ie6 works) http://flowplayer.org/tools/overlay/index.html (ie6 didn't work) http://colorpowered.com/colorbox/ (ie6 works) http://jquery.com/demo/thickbox/ (ie6+) a project worked on 7 months ago used fancybox displaying html loaded ajax. worked well, , never had complaints it. fortunately, didn't have support ie6.

c# - LZ complexity algorithm -

could please explain me thing: how lz complexity algorithm incorporate data compression ? (or meant to) compress data or estimates number of unique substrings in vocabulary? thanks! you can calculate lz complexity without doing compression, although calculation lot happens when lz-compressing input data. see, e.g., calculating lempel-ziv (lz) complexity (aka sequence complexity) of binary string 1 of answers has (non-compressing) code calculating lz complexity.

sql - using distinct command -

using distinct command in sql practice or not? there drawback of distinct command? it depends entirely on use case is. distinct useful in circumstances, can overused. the drawbacks increased load on query engine perform sort (since needs compare resultset remove duplicates), , can used mask issue in data - if getting duplicates there may problem source data. the command isn't inherently or bad. can use screwdriver hammer nail, doesn't mean it's idea, or screwdrivers bad in cases.

c# - Write to file cut off -

my goal take file of sentences, apply basic filtering, , output remaining sentences file , terminal. i'm using hunspell library. here's how sentences file: public static string[] sentencesfromfile_old(string path) { string s = ""; using (streamreader rdr = file.opentext(path)) { s = rdr.readtoend(); } s = s.replace(environment.newline, " "); s = regex.replace(s, @"\s+", " "); s = regex.replace(s, @"\s*?(?:\(.*?\)|\[.*?\]|\{.*?\})", string.empty); string[] sentences = regex.split(s, @"(?<=\. |[!?]+ )"); return sentences; } here's code writes file: list<string> sentences = new list<string>(checker.sentencesfromfile_old(path)); streamwriter w = new streamwriter(outfile); foreach(string x in xs) if(checker.check(x, speller)) { w.writel...