Posts

Showing posts from May, 2011

tsql - T-SQL String to DateTime-conversion -

tsql - T-SQL String to DateTime-conversion - i need cast string values of next formats datetime: 2042-04 2011-01 is there easy way this? i've tried cast , convert without much luck. thanks! try appending "-01" end of , doing cast or convert sql tsql sql-server-2008-r2

javascript - Adding the almighty CDATA tag to some PHP-echoed jQuery -

javascript - Adding the almighty CDATA tag to some PHP-echoed jQuery - attached @ bottom of question code that's beingness echoed out in php-based wordpress plugin. need figure out way create sure javascript wrapped in cdata, becuase it's interfering rss feed generator. help appreciated, i've tried several ways , it's not working correctly. works great plugin except rss feed problem :/ thanks!! echo '<div id="flickr-images">'; echo '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>'; echo '<script type="text/javascript">'; echo ' $(document).ready(function() {'; echo '$.getjson("http://api.flickr.com/services/feeds/photos_public.gne?id=' .$userid. '&format=json&jsoncallback=?", function(data)...

Jquery datetimepicker problem -

Jquery datetimepicker problem - $('#brandtimestamp').datetimepicker({ dateformat: 'mm/dd/yyyy hh:mm:ss' }); datetimepicker() jquery not working in firefox. whenever seek alter value of date adds 100 years date. this code working fine in ie. please suggest solution problem. as believe it, date format in javascript doesn't require yyyy year. date 11/07/2011 date format need dd/mm/yy jquery

c++ - Using RtAudio with Core-Audio, the probeDeviceOpen function fails -

c++ - Using RtAudio with Core-Audio, the probeDeviceOpen function fails - i trying write c++ programme plays real-time processed audio. have decided utilize rtaudio cannot create test programs play audio. i using mac os x, compiled ./configure --with-core , make . after compiling files in test directory, ran ./audioprobe homecoming list. compiled apis: os-x core sound current api: os-x core sound found 3 device(s) ... device name = apple inc.: built-in microphone probe status = successful output channels = 0 input channels = 2 duplex channels = 0 not default output device. not default input device. natively supported info formats: 32-bit float supported sample rates = 44100 48000 88200 96000 device name = apple inc.: built-in input probe status = successful output channels = 0 input channels = 2 duplex channels = 0 not default output device. default input device. natively supported info formats: 32-bit float supported sample rates = 44100 48000 88200 96...

Change .css file from javascript -

Change .css file from javascript - i have in css file: #tabs .bg { background: url("../images/bg-tabs-r.gif") no-repeat scroll 100% 0 transparent; height: 39px; line-height: 42px; overflow: hidden; width: 100%; } through javascript how alter background blank color , line-height 28px . use straight on element: mytab=document.getelementbyid("tabs"); mytab.style.background="white"; mytab.lineheight="28px"; javascript css

Posting in a form using CURL PHP -

Posting in a form using CURL PHP - this form: <textarea name="message" id="messagecontent" rows="18" wrap="virtual" tabindex="2"></textarea> <span id="formsubmit"> <a href="#" class="formsubmit" tabindex="3"> <img src="/clear.gif" class="master-sprite sprite-pm-send"> </a> </span> the formsubmit class ajax function tracked downwards on source code, used fiddler capture params needed post , found this: callcount=1 c0-scriptname=postfunctions c0-methodname=insertpost c0-id=1894_1310435282892 c0-param0=number:1578007 c0-param1=string:hello%20world! xml=true hello world! wrote on textarea , posted, fiddler found cookie on header, not sure if need utilize it. can help ? i'm trying post 2 days now, making me crazy ! thanks request page , split cookie in http headers response example: //get cookies $...

javascript - Prevent selection being greyed out in iframe in Firefox without using contenteditable -

javascript - Prevent selection being greyed out in iframe in Firefox without using contenteditable - in firefox 3 , later (and older versions), selecting content within iframe seems utilize gray selection background colour used document doesn't have focus, if iframe have focus. exception have been able find when content within iframe editable. not case in other browsers. here's illustration illustrating this: http://jsfiddle.net/97vjz/ this unfortunately prevents styling selection within iframe using ::-moz-selection css pseudo-element because applies non-grey selections: http://jsfiddle.net/yyxsy/1/ my question is: possible prevent iframe's selection beingness gray in firefox without using contenteditable / designmode ? update this seems happen on dynamically written iframes: using separate file , src attribute solves problem. however, need work dynamically written iframes. i tried reproduce problem "real" page iframe content , work...

Text To Speech Frequency Problem In android -

Text To Speech Frequency Problem In android - i have been assigned task regarding text-to-speech in particular set of sentences given , has uttered in different languages. problem set frequency of speech using method setspeechrate() frequency changing different languages. example, in app have set frequency rate setspeechrate(1) 2 languages english language , french, frequency in english language fine , able hear sentences when comes french becoming fast , not clear. i think can solved creating different objects texttospeech different languages , set frequency differently. is there other way solve problem? or should go on thought of creating different objects different languages? any suggestions. please help. thank all android text-to-speech frequency

.net - Windows Forms data binding and property path: how to handle nullability? -

.net - Windows Forms data binding and property path: how to handle nullability? - i'm trying implement master/detail scenario mvvm pattern in windows forms project (i'm mad, know). consider next view models: public class masterviewmodel { public bindinglist<detailviewmodel> details { get; set; } public detailviewmodel selecteddetail { { // } set { // raises selecteddetailchanged } } } public class detailviewmodel { public string subproperty { { // ... } set { // ... raises subpropertychanged } } } i'm trying bind detailviewmodel's subproperty textbox, using next code (and property path, supported windows forms databinding): masterviewmodel masterviewmodel; textbox textbox; // ... binding binding = new binding("text", ma...

excel - Transforming a sheet of unique strings to a new sheet with the values -

excel - Transforming a sheet of unique strings to a new sheet with the values - basically has scheme generates study 1 excel file containing 1 column , several rows each register. wants utilize info of study new reports , here problem, how take every value , organize in clean-view new table? here how sheet looks in raw way: worked way take desired part of every string i'm stuck non-formatted sheet follows: the desired result shown follows: the client copy/paste raw study software sheet1(raw data) , need work on show desired on sheet3(clean data), sheet2(separated data) utilize substring rows , select need (as sec image shows). if don't want explain entire process, give me excel function names need , i'll work way it... you create sheet3 sheet2 vba (deleting empty rows...). anyway, if still want utilize formulas, have utilize array formulas decribed in thread: find first non-empty cell in spreadsheet row. feel free update question formula ...

Running new MVC3 solution in VS2010 ASP.NET development server; where is membership database? -

Running new MVC3 solution in VS2010 ASP.NET development server; where is membership database? - i'll preface saying: don't understand how membership providers work in asp.net, , i'm trying understand them better. i created new mvc3 solution in vs2010. can run within asp.net's development server, , works great - cool. i'm little confused how forms authentication working within asp.net development server. consider stock version of accountcontroller.cs : [httppost] public actionresult logon(logonmodel model, string returnurl) { if (modelstate.isvalid) { if (membership.validateuser(model.username, model.password)) { formsauthentication.setauthcookie(model.username, model.rememberme); if (url.islocalurl(returnurl) && returnurl.length > 1 && returnurl.startswith("/") && !returnurl.startswith("//") && !returnurl.startswith("/\\")) ...

jQuery .load(jQuery(this).attr("id")) vs .load("theID") - how to translate? -

jQuery .load(jQuery(this).attr("id")) vs .load("theID") - how to translate? - i have list (menu). when user clicks on link, want load content ajax. article loaded determined based on links id attribute. example: <ul class="ajaxmenu"> <li><a id="services">services</a> ... </u> the variables store links article, named same links' id (i.e. services , url ajax phone call stored on var services) this works: var services = "index.php?option=com_content&view=article&id=2&tmpl=component"; jquery(".ajaxmenu > li > ").click( function(event) { jquery("#contentcomponent").load(services); } ); since line of code jquery(this).attr("id") gives me id, hoping work [it did not work]: var services = "index.php?option=com_content&view=article&id=2&tmpl=component"; var designs = "...

flex - Alert gives PopUpManager error when used with SWFLoader -

flex - Alert gives PopUpManager error when used with SWFLoader - i using swfloader load swf file. code below: <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minwidth="955" minheight="600"> <fx:declarations> <!-- place non-visual elements (e.g., services, value objects) here --> </fx:declarations> <mx:swfloader source="alerttesting.swf"/> </s:application> and alerttesing.swf code given blow: <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" fontfamily="arial" fontsize="12" xmlns:ilog="http://www.ilog.com/2007/ilog/flex" xmlns:local...

printing - Store an image in disk -

printing - Store an image in disk - i have 1x1 inch passport photo , want store in computer disk in way minimize size been able print real world. what recommend me? in advance. update: question image resolution. if have database, consider storing image in blob column, allow relate other information. printing image scanning data-compression

python - pygame.init gives 'there is no soundcard' -

python - pygame.init gives 'there is no soundcard' - everytime run pygame.init() "there no soundcard" message. 1 thread in ubuntu forums said run pygame.init() twice , message disappear. thing is, when write script run script terminal, still no sound card message. what should do? python 2.7.1+ (r271:86832, apr 11 2011, 18:05:24) [gcc 4.5.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import pygame, sys >>> pygame.init() there no soundcard (6, 0) >>> thanks! i same error , prepare on linux-mint14 today. first, utilize apt-cache depends python-pygame see packages depended python-pygame. the result is: 依赖: python2.7 依赖: python 依赖: python 依赖: libc6 依赖: libjpeg8 依赖: libpng12-0 依赖: libportmidi0 依赖: libsdl-image1.2 依赖: libsdl-mixer1.2 依赖: libsdl-ttf2.0-0 依赖: libsdl1.2debian 依赖: libsmpeg0 依赖: libx11-6 依赖: python-numpy 依赖: ttf-freefont font...

google analytics api how to get content drill down using dimension and metrics -

google analytics api how to get content drill down using dimension and metrics - i writing programme myself in want list content drilldown of google analytics. dimension , metrics detail shown in google analytics content drill down? i not exclusively clear mean content drilldown. when go google analytics -> content -> content drilldown, table lists in first column page path. dimension utilize here ga:pagepath. , of course of study select metric want (e.g. visits, pageviews, new visits, bounces, etc). now on google analytics see can farther drill downwards on particular pagepath , list out variations respect query parameters page called with. example, if had pagepath vieworders.php, might have next listed: /vieworders.php?orderid=100 /vieworders.php?orderid=101 etc.... but in api returns pagepage associated parameters (i.e. not separate pagepath queries). have write own routine this. google-analytics-api

c# - How do I convert an Expression to a lambda expression? -

c# - How do I convert an Expression to a lambda expression? - i trying convert look of type expression<func<entity, bool>> func<entity, bool> . the background here trying mock repository homecoming 1 of collection of mock entities given key value. (i hard code input values mocked method seems wrong approach big number of items). so trying mock first method on repository this: var collection = new list<entity> { mockedentity1, mockedentity2, mockedentity3, ... }; mockrepository .setup(rep => rep.first(it.isany<expression<func<entity, bool>>>())) .returns<expression<func<entity, bool>>>(e => collection.first(e)); this doesn't work because collection.first takes func rather expression>. have got point need convert look func contains. perhaps there simpler or improve this? you need phone call compile on expression. c# moq

Problem with IP selection Socket Programming C# -

Problem with IP selection Socket Programming C# - i creating server (desktop based) listens on port 4504 using bit of code ipaddress[] addressar = null; string serverhostname = ""; seek { serverhostname = dns.gethostname(); iphostentry ipentry = dns.gethostbyname(serverhostname); addressar = ipentry.addresslist; } grab (exception) { } if (addressar == null || addressar.length < 1) { homecoming "unable local address ... error"; } listener_socket = new socket(addressfamily.internetwork, sockettype.stream, protocoltype.tcp); listener_socket.bind(new ipendpoint(addressar[0], port)); listener_socket.listen(-1); listener_socket.beginaccept(new asynccallback(endaccept), l...

How to write a Java web-service for which the generated WSDL has multiple bindings -

How to write a Java web-service for which the generated WSDL has multiple bindings - how can write java web-service using standard annotations has generated wsdl multiple bindings (for example, both soap 1.1 , soap 1.2)? java web-services soap wsdl

Excel Pivot Table column value update similar values upon refresh -

Excel Pivot Table column value update similar values upon refresh - i have question regarding excel pivot table. i have series of info in excel spreadsheet. created pivot table using spreadsheet successfully. however when edit cell value of cell in pivot table, rest of values similar updates/changes too. is normal behaviour of pivot table? if want cell alter new value , rest of cells below/above similar values remain is, how go achieving that? thanks! this behaviour normal , called "renaming of pivot table items" (link). don't know want accomplish changing 1 instance of item, can edit concerned line(s) in detail info table , refresh pivot manually grouping sub-items selecting them, right-click -> grouping , show detail -> grouping ... excel pivot-table

svndump - How to extract an SVN dump? -

svndump - How to extract an SVN dump? - i received svn dump file lot of pages (all html pages, , server-side code well) in file. i'd separate them out, have no clue how this. i'm on windows , don't svn @ all. there simple guide here - linux/unix works dos prompt: http://www.mhermans.net/get-files-from-svn-dump.html first - download command line svn http://subversion.apache.org/packages.html#windows can challenge have svn.exe , svnadmin.exe in bin folder somewhere. 1 time have smooth sailing: from dos box: mkdir c:\backup_repo [path svn]\svnadmin.exe init c:\backup_repo type [path dump].dump | [path svn]\svnadmin.exe load [path svn]\svn.exe export "file:///c:\repo" c:\exportdest hth svn svndump

java - Strings copied continuously despite having reinitialized for every different object -

java - Strings copied continuously despite having reinitialized for every different object - private list<string> longstr = new java.util.arraylist<string>(); private list alist = null; private string [] norow = null; private static int arrayctr = 0; seek { csvreader reader1 = new csvreader(new filereader(inputfilepath),';'); if((alist = reader1.readall())!= null){ int outer= 0; string atemp; (int counter= 0;counter <alist.size();counter++){ norow = (string[]) alist.get(counter); (int j = 0; j < norow.length; j++){ atemp = norow[j]; copyarray(atemp); } private int copyarray(string atemp){ longstr.add(arrayctr, atemp); //system.out.println(arrayctr); arrayctr++; homecoming arrayctr; } from extract,every string alist copied norow array->atemp->longstr list.i integrated function jbutton called "read".everytime clicked button diff files input,strings added continuously ie n...

hosts - Open the file with admin privilege in ruby -

hosts - Open the file with admin privilege in ruby - on windows machine(with windows 7 running, x86-64) possible open 'etc/hosts' file in system32/drivers/etc, modify , save ruby? i "not opened writing(ioerror)" error code simple file = file.open("c:/windows/system32/drivers/etc/hosts") file << "new line" instead of trying acquire privileges code ( maybe won't portable across different windows os'es ), this: open command prompt administrator run script there by doing this, programs you're executing have administrative privileges well. edit: problem: file = file.open("c:/windows/system32/drivers/etc/hosts","w") file << "new line" you have open file in write mode. ruby hosts

javascript - jQuery - When not keyPress(), keyUp() for 2 secs do function() -

javascript - jQuery - When not keyPress(), keyUp() for 2 secs do function() - how can set opposite of keypress, keyup, keydown etc. if user starts type , stop, after 2 seconds function(){} i tried onkeypress delay doesn't seem work. thanks you can utilize keypress , global timer. reset timer every time user press key. guess code like: var mytimer = undefined; var delaytime = 2000; // should in miliseconds. function myfunction() { // stuff here } function onkeypress(e) { if (mytimer) { cleartimeout(mytimer); } mytimer = settimeout('myfunction();', delaytime); } ps: have not tested code. javascript jquery

Visual C# verbatim string syntax problem -

Visual C# verbatim string syntax problem - i trying create string literal in visual c sharp. don't know why vs throwing errors html test have inserted @ "" should allow multi line , literal have read, doing wrong? string test = @" <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>untitled document</title> <style type="text/css"> body{font-family:helvetica;} body{font-size:10px;} table{ border-collapse:collapse; } table{border:2px solid black; } table{font-family:helvetica;} table{font-size:17px;} td{border:1px solid #d2b9d3;} td{font-family:helvetica;} ...

layout - Is there a "page rendering completed" event in GWT? -

layout - Is there a "page rendering completed" event in GWT? - i have widget (third-party) calculates size depending on size of parent element. not work because size of parent element 0 during creating of widget. works if phone call onresize() method explicitly when page loaded. calling onresize() in scheduler.scheduledeferred not help because calling before page rendered. how can recognize page rendered , phone call onresize? scheduler.get().scheduleentry(scheduler.repeatingcommand) might you're looking for. gwt layout rendering

iphone - how to open call making /dailing numer view open whenbutton press? -

iphone - how to open call making /dailing numer view open whenbutton press? - enter code here-(ibaction)call:(id)sender{ //[[uiapplication sharedapplication] openurl:[nsurl urlwithstring:@"tel://18005551234"]]; /*nsstring *phonestr = [[nsstring alloc] initwithformat:@"tel:%@",phonenumber.text]; nsurl *phoneurl = [[nsurl alloc] initwithstring:phonestr]; [[uiapplication sharedapplication] openurl:phoneurl]; [phoneurl release]; [phonestr release];*/ nsurl *url = [ [ nsurl alloc ] initwithstring: @"tel:212-555-1234" ]; [[uiapplication sharedapplication] openurl:url]; } in above code utilize various method no 1 working. when implement break-point on function out of scope. problem in this? you should remove hypens "-", , brackets "(", ")" phone number. no special characters should there except numbers. nscharacterset *specialcharset = [nscharacterset charactersetwithcharactersinstring:@" )(-,"]; nsarra...

Why Decompilers cant produce original code theoretically -

Why Decompilers cant produce original code theoretically - i searched net did not find concrete reply why decompilers unable produce original source code. dint satisfactory answer. somewhere written similar halting problem dint tell how. theoretical , technical limitation of creating decompiler perfect. it is, quite simply, many-to-one problem. example, in c: b++; and b+=1; and b = b + 1; may compiled same set of operations 1 time compiler , optimizer done. reorders things, drops in-effective operations, , rewrites entire sections of code. time done, has no thought wrote, pretty thought intended happen, @ raw-cpu (or vcpu) level. it smart plenty remove variables aren't needed: { a=5; b=func(); c=a+b; d=func2(c); } ## gets rewritten as: registera=func() registera+=5 return(func2(registera)) decompiler

clojure - Executing a function with a timeout -

clojure - Executing a function with a timeout - what idiomatic way of executing function within time limit? like, (with-timeout 5000 (do-somthing)) unless do-something returns within 5000 throw exception or homecoming nil. edit: before points out there is, clojure (with-timeout ... macro) but future keeps executing not work in case. this isn't can 100% reliably on jvm. way stop after while give new thread, , send thread exception when want stop. code can grab exception, or can spin thread don't control, or... but of time, , if command code that's beingness timed out, can in clojail: if wanted create prettier define macro like (defmacro with-timeout [time & body] `(thunk-timeout (fn [] ~@body) ~time)) clojure

amd processor - What is the cost of converting 32-bit integer to double for Intel and AMD architecture? -

amd processor - What is the cost of converting 32-bit integer to double for Intel and AMD architecture? - i'm under impression conversions , forth between these 2 representations not expensive operations on modern hardware, true? intel says can rather expensive (on pentium 4 visual c++ 6), using intels' vtune performance analyser, can turn heavy, slow, _ftol phone call single fistp fpu instruction 5x performance gain. then enabling sse2 instructions give 11x performance gain, hear has high latency penatly. there's farther speed using sse3. so, i'm not sure performance nowadays, although think sse2 enabled default in vc++, i'm pretty sure in gcc. intel amd-processor

css - Javascript for breaks in multi-column layout -

css - Javascript for breaks in multi-column layout - i'm using multi-column css in fixed height element browser creates many columns needs contain content. new columns appear right of other columns, break after 3 columns , have columns 4,5,6 appear below 1,2,3. imagine can done js, don't know select. thanks, here's code: .columns { width: 360px; font-size: 100%; text-align: justify; height: 300px; display: block; padding-bottom: 30px; -moz-column-gap: 20px; -webkit-column-gap: 20px; -moz-column-width: 100px; -webkit-column-width: 1000px; -moz-column-gap: 40px; -webkit-column-gap: 40px; } <div class="columns"><p>lorem ipsum.../p></div> you set columned element in container width need , overflow:hidden. utilize javascript clone columned element, set clone in container (directly after original) , give clone either margin-left: -100% or relative positioning. jav...

Error while linking program to boost thread library -

Error while linking program to boost thread library - i had build boost library threading. gave command ./bootstrap.sh in boost_1_46_1 directory. bjam --toolset=gcc --build-type=complete --with-thread link=static stage when tried compile simple programme involving threads, using command below, errors. g++ -i/home/sharatds/downloads/boost_1_46_1 /home/sharatds/downloads/boost_1_46_1/stage/lib/libboost_thread.a main.cpp -o ini main.cpp:(.text+0x804): undefined reference `boost::thread::join()' main.cpp:(.text+0x9ec): undefined reference `boost::thread::~thread()' am missing ? i think build command malformed. explicitly listing archive library in unusual way, , think gcc ignoring or misinterpreting it. try separating build 2 steps. 1 step compile .cpp file .o, , link .o boost_thread archive library , emit executable. g++ -i/home/sharatds/downloads/boost_1_46_1 main.cpp -o main.o g++ main -o ini -l/home/sharatds/downloads/boost_1_46_1/stage/lib/...

jsf - Preselect items in h:selectManyCheckbox -

jsf - Preselect items in h:selectManyCheckbox - how preselect elements in h:selectmanycheckbox component? i've searched through properties of f:selectitem tag not yet have found how pre-select item (i.e. ticked when site called). the value attribute of h:selectmanycheckbox can take array of string managed bean. can straight set default values array when managed bean initialized. for illustration , in view : <h:selectmanycheckbox value="#{mbean.choice}"> <f:selectitem itemvalue="a" itemlabel="choice a" /> <f:selectitem itemvalue="b" itemlabel="choice b" /> <f:selectitem itemvalue="c" itemlabel="choice c"/> <f:selectitem itemvalue="d" itemlabel="choice d" /> </h:selectmanycheckbox> then in mbean : public class mbean{ //preselect "choice a" , "choice c" private string[] choice= {"a...

visual studio - Stetic in MonoDevelop -

visual studio - Stetic in MonoDevelop - i've read online can utilize called stetic edit gui objects (such forms) in visual way (similar visualstudio) in monodevelop. can't find however, on how install stetic re-create of monodevelop. i'm on ubuntu. any ideas? stetic built-in. create new gtk# project. visual-studio ubuntu monodevelop

php - Switching databases in code igniter -

php - Switching databases in code igniter - i have 2 databases need connect to, can in controllers , libraries have written. odd reason (i'm assuming i'm missing simple here) can't work in model of sudden. have read database class in ci user guide. i tried making reference $pew when loading pew ($this->pew =& $this->load->database('pew', true)) no avail. any thoughts, suggestions? thanks! error php fatal error: phone call fellow member function query() on non-object in /sites/ci/nyan/application/models/pewpewmodel.php on line 15 line 15 $this->pew->query('select * extractevent'); //simplified testing database.php: $active_group = 'nyan'; $active_record = true; $db['nyan']['hostname'] = 'catcatcat'; $db['nyan']['username'] = 'mew'; $db['nyan']['password'] = 'meow'; $db['nyan']['database'] = 'meow'; $db['n...

c# - problem with finding a point (2D) -

c# - problem with finding a point (2D) - i working c# , have 3 system.drawing.point variables ( a , b , c ) , angle of alpha . i need find point on side 'a' , don't know how manage this. the angles alpha , beta have same size! assuming text right , image wrong, definition points on a follow equation: p=t*b+(1-t)*c, 0<=t<=1 where a , b , c extremities of triangle. c# 2d point

Render Esri Map in Sencha-Touch -

Render Esri Map in Sencha-Touch - i've got problem render esri map sencha touch. display tabpanel tab containing map, , 3 other tabs. problem when i'm on tab map-tab, when resize window (or alter orientation of phone), map diseapears. identified source of problem. when resize window beingness on tab, map tab goes current size 0x0 new size. problem when width , height set 0x0, esri map require tiles of dimension 0x0, , error appears. tried set minwidth , minheight tab without success. have clue how prepare ?? give thanks in advance ! i believe had same problem (i didn't know exact cause @ time). whenever orientation of screen changed manually changing dimensions of esri map match panel , firing map's reposition , resize methods. however, if fired different panel, basemaps drop out of map. i able prepare calling next function every time orientation changed, or map panel set active: function resizemapdiv(){ if (apppanel.getactiveitem() ==...

javascript - Can anyone explain why array.length would return two different results here? -

javascript - Can anyone explain why array.length would return two different results here? - can please @ this: (function ($) { $.fn.extend({ grid: function (settings) { var defaults = { data: [ ['code','name','email','other'], [1,'john','john@domain.com','johny'], [2,'bob','bob@domain.com','bobby'], [3,'jenny','jenny@domain.com','jen'], [4,'mary','mary@domain.com','maryann'] ], test: this.data.length }; var config = $.extend(defaults, settings); homecoming this.each(function(){ this.innerhtml = config.data.length; this.innerhtml += "<br />" + config.test; }); } }); }(jquer...

c# - List Generic IEnumerable has some invalid arguments -

c# - List Generic IEnumerable has some invalid arguments - i'm trying improve programme builds generic list of strings follows: list<string> filelist = new list<string>(directory.getfiles(root, "*.xml", searchoption.alldirectories)); to different generic list more flexible: list<inputfileinfo> filelist = list<inputfileinfo>(directory.getfiles(root, "*.xml", searchoption.alldirectories)); public class inputfileinfo { public string _fullpath { get; set; } public string _message { get; set; } public int _rowcount { get; set; } public inputfileinfo(string fname) { _fullpath = fname; _rowcount = 0; _message = string.empty; } } directory.getfiles returns string array , guess inputfileinfo constructor not sufficient. need loop thru string array , populate list using .add method each element of .getfiles array or there way populate new list in 1 statement list of strings? ...

python - Celery daemon script not going in background with init script -

python - Celery daemon script not going in background with init script - the celery docs says that however, in production want run worker in background daemon. i made init.d script below #!/bin/sh # # chkconfig: 345 99 15 # description: celery init.d # chdir @ start. celeryd_chdir="/home/username/django/django_myapp" # how phone call "manage.py celeryd_multi" celeryd="/opt/python27/bin/python manage.py celeryd " #celeryd_multi="$celeryd_chdir/manage.py celeryd_multi" # arguments celeryd celeryd_opts="--time-limit 300 --concurrency=8" # name of celery config module. celery_config_module="celeryconfig" # %n replaced nodename. celeryd_log_file="/var/log/celery/%n.log" celeryd_pid_file="/var/run/celery/%n.pid" # workers should run unprivileged user. celeryd_user="root" celeryd_group="celery" # name of projects settings module. export django_settings_module="settings...

regex - regular expression for find and replace -

regex - regular expression for find and replace - i've got strings like: ('michael herold','michael herold'), but need remove lastly parts end with: ('michael herold'), i'm still new regular expressions confuse me. i'm using notepad++. find: \('([^']*)','\1'\) replace: ('\1') regex notepad++

multiple inheritance - C++ Resolving the diamond problem -

multiple inheritance - C++ Resolving the diamond problem - couldn't diamond problem resolved using first inherited declaration found? mean, public class { public virtual int getint(); }; public class b : public { public int getint() {return 6;} }; public class c : public { public int getint() {return 7;} }; public class d: public b, public c {}; for class d , since b listed first, couldn't default (when it's ambiguous) utilize b::getint() if d::getint() called? kind of how path environment variable works in unix , other os's; if 2 things exist same name in different locations in path variable, first location shall used default (unless otherwise qualified). edit: 'first' inherited declaration found mean according simple left-to-right depth-first order edit#2: updated above implementation more diamond-like. it's buggy solution. think happen in next case: public class { public int getint() {return 5;} public...

binary - SAS : read in PDF file -

binary - SAS : read in PDF file - i looking ways read in pdf file sas. apparently not basic functionality , there little found on internet. (let lone google not easy pdf in search giving links pdf documents go other things.) the things can found, people looking ways import info datasets pdf. me, not necesarry. able read contents of pdf file in 1 big character variable. if possible, improve able read in file's binary data. is possible sas , how? (i got work in access vba, can't find similar ways in sas.) (in end, purpose convert base64 , set base64-string xml document.) you not able read entire file 1 character variable since maximum size of character variable around 33 kb. simple way read in 1 line @ time, though, following: %let pdffilename = test.pdf; %let linesize = 2000; info base; format text_line $&linesize..; infile "&pdffilename" lrecl=&linesize; input text_line $; run; this requires have general thought o...

javascript - Item position type shift from relative to static effect? -

javascript - Item position type shift from relative to static effect? - how effect named ? how implemented you can see on this page on portofolio filter box. i've seen around year, it's interesting pattern, it's famous gmail uses it. you can view javascript use: fixed.js their css: #rightfloat { float: right; padding-top: 20px; position: absolute; top: 0; width: 205px; } #rightfloat.fixed { position: fixed; top: 0; } what name? have no clue if has name :) bet people phone call 100 different things. [edit:] names have heard : sticky scroll, contained sticky scroll, conditional sticky scroll, watermarked content. javascript html css effects

Rails - Need help setting up loosely coupled associations -

Rails - Need help setting up loosely coupled associations - i have next models, relevant associations: class user < activerecord::base has_many :reviews has_many :ratings end class product < activerecord::base has_many :reviews has_many :ratings end class review < activerecord::base belongs_to :product belongs_to :user end class rating < activerecord::base belongs_to :product belongs_to :user end given specific rating , need corresponding review (if review exists). i need maintain ratings , reviews loosely coupled. (i not want set model review belongs_to rating ) how should set rating's association reviews ? once i'm working specific rating in view, can phone call @rating.product.reviews.where(:user_id => @rating.user.id).first , i'd cleaner/more efficient if possible. any ideas? thanks. try using :conditions so: class rating < activerecord::base has_many :reviews, :through => :use...

Android Activity and Service relationship - after Pause, after Stop -

Android Activity and Service relationship - after Pause, after Stop - let's activity created , starts service s , binds s. s notifies of updates cause state of change. what happens , s after android pauses or stops a? for instance: does pausing automatically unbind s (thus stopping s if lastly thing bound it?) do updates s cause resumed? do updates s never passed , no error occurs? can s become aware paused or stopped? (for instance phone call a.isasleep() ) also, how handle situation "right thing" happens? unbind services in onpause() , re-bind upon onresume()? (a) unbound (s) onpause, if didn't phone call unbind method, think memory leak. unless rebind (a) (s) onresume(), (a) note aware of (s) unless activity recreated. depends on how sending updates. npe's can happen sure if @ reference (a) , happens destroyed while paused. (s) aware (a) paused if have method of communicating (s) have done. and yes, have right. should bind , un...

c# - Error when splitting string with string -

c# - Error when splitting string with string - how can split string string? string postbuffer = "this first----webkitformboundarybbzbllwzo0cicua6this last" string[] bufferarray = postbuffer.split("----webkitformboundarybbzbllwzo0cicua6", stringsplitoptions.none); i , error cannot convert argument '1' string char , argument '2' cannot convert system.stringsplitoptions char. what doing wrong? postbuffer.split(new string[] { "----webkitformboundarybbzbllwzo0cicua6"}, stringsplitoptions.none); c# asp.net visual-studio split string-split

iphone - ios how to get internet data from 3g and application specific data from Wifi -

iphone - ios how to get internet data from 3g and application specific data from Wifi - question community. doing application record position on mapview based coordinate point beingness updated server application. server application sends out info using wifi , can see updating position of annotation info comes in. problem comes when seek zoom mapview, seems pixelated. did trials runs , turns out reason iphone not update tiles of mapview because trying info wifi connection opposed 3g connection. my question, how (if possible) forcefulness mapview it's tile updates 3g connection. aware go "offline maps" route, see if can done. thank kindly. are testing within closed network wifi connection not reach outside world? why can wifi connection not reach map tiles? talking google tiles? if speak network admin , inquire if need proxies set up. not needs fixed in code, it's network issue. iphone utilize whatever network can find info needs, need create...

php - cakephp and paypal - how do I check if a user on my site is using a valid paypal email address? -

php - cakephp and paypal - how do I check if a user on my site is using a valid paypal email address? - firstly know there lot of documentation on paypal website it's confusing , not related cakephp. i've never built app using paypal before , i'm bit greenish cakephp too! i'm confused , in need of kindly soul provide little direction. i'm trying build site users can sign , create profile me. able receive payments 3rd parties straight paypal accounts (with little commission going me) i understand need utilize adaptive payments api , want possible somehow - haven't quite figured out yet. however, first thing need when user signs site want connect email address paypal business relationship create sure have paypal account. ie when clicks sign up, app connects paypal , links profile on site paypal account. can suggest how might go doing this? eternally grateful sarah :) ps i've seen cakephp plugin mentioned fair bit - of utilize me? http://...

asp.net mvc 3 - Based on Model Column Value(true/False) in MVC3 Webgrid , How can Add a Link as column in diplaying the rows -

asp.net mvc 3 - Based on Model Column Value(true/False) in MVC3 Webgrid , How can Add a Link as column in diplaying the rows - i using mvc3 webgrid. have model has column of type bool. based on value of coulumn need render coulmn , hyper link. if bool column value true have render record, else edit. could kindly give syntax these in razor . thank you you can utilize if statement when create column, so: grid.column("conditional cell sample", format: @<text>@if(true == true) { @html.actionlink("go here", "home") } else { @html.actionlink("or here", "away") }</text>) simply replace true == true condition, , content of if , else need. ref: http://lottemae.wordpress.com/2011/11/17/using-conditional-statements-in-an-mvc-3-webgrid-column-using-razor/ asp.net-mvc-3

validation - Problem with Boolean Values in PHP -

validation - Problem with Boolean Values in PHP - i've problems handling boolean values in php. validation script before storing info database. wrote global validator validate , homecoming boolean value whether validation successful . here code. //validate $isvalid = true; foreach($team $key=>$val) { if(!is_array($val)){ $isvalid = $isvalid && validate($val, $key); } } for($it=0;$it<count($team['members']);$it++){ foreach($team['members'][$it] $key=>$val) { $isvalid = $isvalid && validate($val, $key); } } if(!$isvalid) { // edited: if(!isvalid) echo "validation error"; exit(1); } //end of validate the validate function working end getting $isvalid = true or other way, when seek test cases. hmm.. doing wrong here ? please check, if form trick: if( false === $isvalid) { echo "validation e...

html - Toggling between links jQuery -

html - Toggling between links jQuery - js: <script type="text/javascript"> <script type="text/javascript"> function slideupall(id){ if(id != "about") $('#about').slideup(); if(id != "team") $('#team').slideup(); if(id != "contact") $('#contact').slideup(); if(id != "job") $('#job').slideup(); } function sd_about(){$('#about').slidedown("slow");} function sd_team(){$('#team').slidedown("slow");} function sd_contact(){$('#contact').slidedown("slow");} function sd_job(){$('#job').slidedown("slow");} $(function(){ $("#about").delegate("anchorordivorimg", "mousedown", function(e){ slideupall(e.target.id); }); }); </script> html: <div id="nav"> <ul> <li><a href="#...

git - How can I unstage my files again after making a local commit? -

git - How can I unstage my files again after making a local commit? - i have done next command git add together <foo.java> git commit -m "add foo java" how can delete local commit , create foo.java in unstaged state? if type git reset --hard , found revert modify foo.java original one. git reset --soft head^ should want. after this, you'll have first changes in index (visible git diff --cached ), , newest changes not staged. git status this: # on branch master # changes committed: # (use "git reset head <file>..." unstage) # # modified: foo.java # # changes not staged commit: # (use "git add together <file>..." update committed) # (use "git checkout -- <file>..." discard changes in working directory) # # modified: foo.java # you can git add together foo.java , commit both changes @ once. git

multithreading - python add time to a countdown already running -

multithreading - python add time to a countdown already running - i want have app if click button add together x amount of time running countdown timer. i'm guessing have utilize threads not sure how implement it.. here code have far: def countdown_controller(add_time): end_it = false def timer(time_this): start = time.time() lastprinted = 0 finish = start + time_this while time.time() < finish: = int(time.time()) if != lastprinted: time_left = int(finish - now) print time_left lastprinted = if end_it == true: = finish time.sleep(0.1) # check if counter running otherwise add together time. try: time_left except nameerror: timer(add_time) else: if time_left == 0: timer(add_time) else: add_this = time_left end_it = true while...

xcode - Change a loaded image based on a NSUserDefaults setting -

xcode - Change a loaded image based on a NSUserDefaults setting - hope can help me this. have app needs show 1 of 2 maps via setting of uiswitch. settings.bundle set , trying write if statement determine if switch on or off, , display right image. nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; bool enabled = [defaults boolforkey:@"zones_preference"]; if (enabled == @"enabled") { [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"withzones.jpg"]]; } else { [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"withoutzones.jpg"]]; } this builds without error, doesn't load image scrollview. advise on going wrong? well, code you've posted creates uiimageview object , doesn't more. it's leak too. there's 1 more error in line if (enabled == @"enabled") { here, comparing boolean string evaluate false automatically needs corrected too. nsuserdefaults *def...

Convert image and audio files to binary in Java -

Convert image and audio files to binary in Java - i want convert image , sound file binary stream, process , reconstruct image same binary stream in java. how can that? has worked on this? please help me out possible. hints or pseudocode highly appreciated. how tried creates empty file while reconstructing image. image binary:- file file = new file("e:\\image.jpg"); bufferedimage img = imageio.read(file); // write image byte array in-memory (jpg format) bytearrayoutputstream b = new bytearrayoutputstream(); imageio.write(img, "jpg", b); byte[] jpgbytearray = b.tobytearray(); // convert string 0s , 1s stringbuilder sb = new stringbuilder(); (byte : jpgbytearray) { sb.append(integer.tobinarystring(by & 0xff)); for binary image:- byte[] original = obj.orig_seq.getbytes(); inputstream in = new bytearrayinputstream(original); bufferedimage im...

packing - Why doesn't C++ make the structure tighter? -

packing - Why doesn't C++ make the structure tighter? - for example, have class , class naive { public: char a; long long b; char c; int d; }; and according testing program, a d built 1 after another, like a------- bbbbbbbb c---dddd - means unused. why not c++ create tighter, like ac--dddd bbbbbbbb class , struct members required standard stored in memory in same order in declared. in example, wouldn't possible d appear before b . also, architectures prefer multi-byte types aligned on 4- or 8-byte boundaries. compiler can leave empty padding bytes between class members. you can minimize padding reordering members yourself, in increasing or decreasing size order. or compiler might have #pragma pack alternative or similar, seek minimize padding @ possible expense of performance , code size. read docs compiler. c++ packing

c++ - std::atoll with VC++ -

c++ - std::atoll with VC++ - i have been using std::atoll cstdlib convert string int64_t gcc. function not seem available on windows toolchain (using visual studio express 2010). best alternative? i interested in converting strings uint64_t . integer definitions taken cstdint . msvc have _atoi64 , similar functions, see here for unsigned 64 bit types, see _strtoui64 c++ int64 uint64 strtol

javascript - Drawing rectangles in web application that show screen position from windows -

javascript - Drawing rectangles in web application that show screen position from windows - i have input string this: { (3200, 1080), (1280, 0) ; (1280, 1024), (0, 0) } which input c# programme takes coordinates of screens. the numbers in brackets coordinates of lower right , upper left point , define rectangle. example: (1280, 1024), (0, 0) means first screen has dimensions 1280 x 1024 , starts in upper left point (0,0). next sec screen upper left point @ coordinate (1280, 0) , lower right coordinate @ point (3200, 1080) - , form rectangle. what have draw these screen in web application - nil fancy 2 different colored rectangles do. now, did little research , saw html5 canvas might way go, want hear think , maybe give me force in right direction. if give jsfiddle illustration appreciated! you utilize divs position: absolute , detailed on this jsfiddle (jquery used sake of simplicity, same can accomplished without jquery). edit (i added code if rea...

android - Long delay between ProgressDialog.dismiss() and AlertDialog.show() -

android - Long delay between ProgressDialog.dismiss() and AlertDialog.show() - i'm using standard progressdialog implementation: set thread run long task, , when it's done dismisses progressdialog. @override public void oncreate( bundle bundle ) { super.oncreate( bundle ); context = this; progress = progressdialog.show( this, "running", "please wait..", true, false); progress.setondismisslistener( new ondismisslistener() { public void ondismiss(dialoginterface dialog) { showresults(); } }); new deletethread().start(); } and thread looks this: private class deletethread extends thread { public deletethread() {} @override public void run() { // long process during populate // linearlayout many other views progress.dismiss(); } } and in showresults() take linearlayout filled views , set content of alertdial...

to load the data when application starts in ipad -

to load the data when application starts in ipad - i noticed in ipad, programme not initialize when open application. application restored state when closed application. 1 please inform me should phone call method each time start application. this because application not quit when minimized. in xcode project navigator (on left), click on project (top). in main area, take app under targets. on top, take "info". add together line, "application not run in background" , set value yes. this create application quit when home button pressed. ipad

c# - SqlBulkCopy Insert with Identity Column -

c# - SqlBulkCopy Insert with Identity Column - i using sqlbulkcopy object insert couple 1000000 generated rows database. problem table inserting has identity column. have tried setting sqlbulkcopyoptions sqlbulkcopyoptions.keepidentity , setting identity column 0 's, dbnull.value , null . none of have worked. sense missing pretty simple, if enlighten me fantastic. thanks! edit clarify, not have identity values set in datatable importing. want them generated part of import. edit 2 here code utilize create base of operations sqlbulkcopy object. sqlbulkcopy sbc = getbulkcopy(sqlbulkcopyoptions.keepidentity); sbc.destinationtablename = lookup_table; private static sqlbulkcopy getbulkcopy(sqlbulkcopyoptions options = sqlbulkcopyoptions.default) { configuration cfg = webconfigurationmanager.openwebconfiguration("/rswifi"); string connstring = cfg.connectionstrings.connectionstrings["wifidata"].connectionstring; homecomi...

c# - .NET OPOS MSR - Detect Timeout or better, a straight USB communication alternative -

c# - .NET OPOS MSR - Detect Timeout or better, a straight USB communication alternative - i having issue connecting opos device, , if device gets disconnected returning status of 2. because of have no way of knowing if device needs reconnect. part, reconnects me, not always, , since don't know how observe when needs it, have restart programme (or add together reconnect button) reconnect device. does know of type of "ping" or "heartbeat" action know, in realtime, if opos msr item connected? even better, possible alternative straight usb communication? opos compliant application have assume follows basic usb protocol utilize straight communicate it? thanks in advanec c# vb.net opos

flex how to refresh already created view -

flex how to refresh already created view - how can refresh view after event? i have view contains multiple groups. want show or hide groups. oncreationcomplete() or initialize() method works @ origin of view creation. try invalidatedisplaylist() on view let me know if doesn't trick , we'll seek other tricks. flex view refresh

Variable from Javascript -> Php -> Smarty... is it possible? -

Variable from Javascript -> Php -> Smarty... is it possible? - example: <script type="text/javascript"> insertvideos({ 'block':'youtubediv', 'q':'keyword', 'type':'search', 'results':8, 'order':'most_relevance', 'player':'embed', 'layout':'thumbnails' }); </script> i need 'results' variable pass, @ end of process need like: {if $results != 0} how can it? there isn't way access php/smarty in javascript executed in 2 different worlds. the page requested server. server executes php , generates content smarty. server sends resulting html , javascript source code client. server done. if request received, starts on anew without knowledge of previous request. the client receives html , javascript source , displays. insertvideos method gets calls. @ point, has no in...

java - Writing only the Value on Mapper Job -

java - Writing only the Value on Mapper Job - i working on mapreduce job using mapper without reducer. not need write key out because need values stored in array , want write out final output file. how can accomplish on hadoop? instead of writing output both key , value, interested in writing out values. values in array. thanks public void pfor(testfor pfor,longwritable key, text value, context context, int times) throws ioexception, interruptedexception{ int n = 0; while(n < times){ pfor.pformap(key,value, context); n++; } for(int =0;i<uv.length; i++){ log.info(uv[i].get() + " final output"); } intarraywritable border = new intarraywritable(); edge.set(uv); context.write(new intwritable(java.lang.math.abs(randgen.nextint())), edge); uv= null; } use nullwritable value , emit "edge" key. https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/io/nullwritable.html ...

security - jQuery Modal Dialog, ie6 secure non-secure error, https ssl -

security - jQuery Modal Dialog, ie6 secure non-secure error, https ssl - (please don't bother asking why back upwards ie6.) we're creating custom alert/confirms using jquery modal dialog. i've created div xsl (in examples, took of xsl out , set in raw html avoid confusion). div triggered using jquery. wrote couple functions (that open dialog, pass message, , function) can implement new alert/confirm using javascript (basically replacing alert(); uialerterror();). some of info not important. can more specific, main issue here in ie6 "this page contains both secure , nonsecure items, want display nonsecure items?" error. works correctly in ie7, ie8, firefox, safari, , chrome. from i've read there mutual issues such as: http:// needing https:// (or http:// //, alter relative opposed absolute), src's empty, mixed content, etc. underlying theme of of (from i've gathered) getting things load secure, since we're on secure page. not issue!...

opengl es - iPhone : Moving in 3D Space (stepping sideways using gluLookAt) -

opengl es - iPhone : Moving in 3D Space (stepping sideways using gluLookAt) - i have written 3d environment in opengl can move forward/backwards , around (up/down left/right) cant work out how can side step left of right. i using glulookat , moving forwards code is glfloat v[] = {[self centeratindex:0] - [self eyeatindex:0],[self centeratindex:1] - [self eyeatindex:1], [self centeratindex:2] - [self eyeatindex:2]}; [self seteye:[self eyeatindex:0] + v[0] * speed_move atindex:0]; [self seteye:[self eyeatindex:2] + v[2] * speed_move atindex:2]; [self setcenter: [self centeratindex:0] + v[0] * speed_move atindex:0]; [self setcenter: [self centeratindex:2] + v[2] * speed_move atindex:2]; and glulookat(eye[0], eye[1], eye[2],center[0], center[1], center[2], 0.0, 1, 0.0); anyone got thought how side step or seen example? solution float up[3] = {0, 1, 0}; float forward[3] = { center[0] - eye[0],center[1] - eye[1],center[2] - eye[2] }; float left[...

actionscript 3 - Event listener to keyboard event not listening in a module -

actionscript 3 - Event listener to keyboard event not listening in a module - i doing within module containing viewstacks , childs. calling oninit() on creationcomplete of module. when within 1 of childs of viewstack of module , press enter, doesnt not invoke listener function @ (bp within not hit). private function oninit():void{ this.addeventlistener(keyboardevent.key_down, keypressed); } private function keypressed(evt:keyboardevent):void {//this breakpoint never gets nail on pressing key in screen if (evt.keycode == keyboard.enter) { //do } } you should add together key listeners stage objects: private function oninit():void{ this.stage.addeventlistener(keyboardevent.key_down, keypressed); } actionscript-3 flex flex3

.net - Model binding to Lists -

.net - Model binding to Lists - how create default modelbinding handle lists? let’s have shoppingcart class, has shoppingcartitem list: public class shoppingcart public property couponcode string public property items new list(of shoppingcartitem) end class public class shoppingcartitem public property title string public property count integer end class my view looks (as per advice this, , this, blogpost): @modeltype vavtag.luckydraw.shoppingcart @code layout = nil end code <!doctype html> <html> <head runat="server"> <title>index</title> </head> <body> @using html.beginform() @<fieldset> <legend>shoppingcart</legend> @html.textboxfor(function(m) m.couponcode) <hr /> @html.editorfor(function(m) m.items) <p> <input type="submit" value="save" /> </p> </fieldset> end using </body...