Posts

Showing posts from March, 2010

sql server - Counting occurrences for each row and update to new column -

Image
i have table: i need count occurrence of same line in column closetime , write number of occurrences in last column count clause item , same account. my single select concrete item , account select closetime, count(*) closetime statement account = 2013169 , item = 'eurusd' group closetime having count(*) > 1 order count(*) desc it possible count in 1 update query? depending on use case, not idea. better off creating "count" calculated column or leaving off base table entirely , creating view included count column. also, avoid trying have column name reserved word, count. however, if want it, can in 1 query. make sure on same page, belive trying group closetime , account , item not included in group (so, counted if same close time , different item), want able update target account , item. in case, like with cte1 (select closetime, count(*) numcount dbo.[statement] group closetime) update dbo.[statement] set [count] = cte1.numcount dbo.[statement] sd join...

Track access violation in Delphi -

i'd track access violation error triggered. threads created , perform jobs. suspect them access vcl or variables without "synchronise". madexcept report show access violation occurs on form close (form1.close;), no more precision. i've got many lines of codes (around 100.000). what should avoid spending time ? i've checked "range checking" in debugger option. many thanks if want know, can build project debug dcu's , put breakpoint before point exception occurs. now can jump vcl code , see goes wrong. but access violations in close or destructors because of double freeïng of object. example, free component freed form (because owned form).

css - Hosted web fonts, CDN's, @font-face, and privacy -

if use hosted fonts on cdn, @font-face, or service typekit, possible host read characters being rendered font in pages (and therefore read content of pages)? if so, seems significant privacy issue. any expertise or recommended reading on topic? web fonts stored monolithic files (woff, otf, eot or svg) must fetched browser in entirety display character in them. it's not possible detect usage of single characters. there potential privacy leak in web font embedding it's more subtle that, , unlikely exploitable anything. it occurs when using web font fallback font, example: @font-face { font-family: "one"; src: url(http://themes.googleusercontent.com/static/fonts/overlock/v2/pr-80_x4sioocpxz2vxc5feszw2xoq-xsnqo47m55da.woff) format('woff'); } @font-face { font-family: "two"; src: url(http://themes.googleusercontent.com/static/fonts/overlock/v2/ecjpf2hw5gsz4m16yldg84bn6udyhwbl620a-irfubk.woff) format('woff'); } p { font-family: "one...

c# - PropertyInfo.GetValue returned object is not seen as null by visual studio / resharper -

i'm retrieving value of property calling getvalue so: //have t tobj; var sexpr = s.body memberexpression; var sprop = typeof(t).getproperty(sexpr.member.name); var sval = dprop.getvalue(tobj, null); for reason sval never considered null compiler/resharper (i'm not sure 1 showing warning). don't possible null reference warnings @ design time. if create condition if(sval == null) i'll design time warning expression false. sval object, , objects can null. don't think getvalue guarantees never return null. what's going on? john skeet right. checking null after working variable. rearranged code null check before working variable , problem went away. strange didn't null reference warning before , should have.

single sign on - What is Shib Daemon used for? -

i new saml world. installed shibboleth sp , idp, , made them work each other. trying understand how works under hood. the question is: when install sp apache on windows, can choose whether install shib daemon or not. can tells me used for? optional make sp work? i have tried google , searched old posts, cannot find details. understand shib sp module runs on apache(for install), , responsible for: setting trust connection idp handle request browser, , redirect idp handle response idp , redirect user's real application page. it seems me shib daemon not involved in these works. did miss or misunderstood anything? thanks much! i can explain how works on linux shibd , apache, , think similar way works on windows. the shibd process processes of saml 2.0 assertions. assertions received apache, there mod_shibd module apache talks shibd process. allows shibd daemon not reside in same process space apache. thus, need shib daemon installed, , need apache , mod_shibd module inst...

r - strsplit by variable separator -

i have strings of data separated " " needs split columns. there easy way split data every nth separator. example, first value in x tells first 4 values in y correspond first trial. second value in x tells next 3 values in y correspond second trial, , on. x <- c("4 3 3", "3 3 3 2 3") y <- c("110 88 77 66 55 44 33 22 33 44 11 22 11", "44 55 66 33 22 11 22 33 44 55 66 77 88 66 77 88") the goal this: structure(list(session = 1:2, trial.1 = structure(1:2, .label = c("110 88 77", "44 55 66"), class = "factor"), trial.2 = structure(c(2l, 1l), .label = c("33 22 11", "66 55 44"), class = "factor"), trial.3 = structure(1:2, .label = c("22 33 44", "23 33 44"), class = "factor"), trial.4 = structure(c(na, 1l), .label = "55 66", class = "factor"), trial.5 = structure(c(na, 1l), .label = "77 88 66", class = "factor...

ember.js - Ember Data - Uncaught TypeError: Cannot read property 'find' of undefined -

using latest (from github today) ember , ember data, code giving me error - uncaught typeerror: cannot read property 'find' of undefined @ ember-data-latest.js:3170 http://jsfiddle.net/bf43w/9/ // needed on jsfiddle; trigger route history.pushstate("", "", "/projects/1/tasks"); app = ember.application.create({}); app.store = ds.store.extend({ revision: 4, adapter: ds.restadapter.create() }); app.project = ds.model.extend({ name: ds.attr('string') }); app.applicationcontroller = ember.objectcontroller.extend({ }); app.applicationview = ember.view.extend({ templatename: 'application' }); app.tasksview = ember.view.extend({ templatename: 'tasks' }); app.router = ember.router.extend({ root: ember.route.extend({ tasks: ember.route.extend({ route: '/projects/:project_id/tasks', connectoutlets: function(router) { router.get('applicationcontroller').connectoutlet('tasks'); } }) }) }); app.router = app.rout...

asp.net - IE not wrapping around floating div but FF is -

Image
i have webpage working in firefox. in ie doesnt wrap properly. the parents div both columns is: .underbars { left:0; right:0; top: 140px; position: absolute; } in div there 2 divs, 1 floating , other should sit directly right of floating div, reason second div not floating because want take left on space. in ie second div sits directly under first div. floating div: (should on left hand side) .cabinetpane { border-right: 1px solid #c1c0c1; border-right-style: solid; border-bottom-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-right-color: #c1c0c1; border-bottom-color: #c1c0c1; font-size: 12px; color: #3b4f65; } wrapping div (should directly right , take available space) <div> </div> //no css 1 best solution come have div has single purpose of aligning things (it structure, no color / borders displayed). here box model: that div im talking 1 want "take left on space" aka orange box. inside div style applied dictates, div have ...

php - How to print multiple ID's from a $_GET variable using while() and array() -

i'm here today because i'm under minor issue can't seem solve , it's why brings here. issue i'm trying multiple id's $_get variable print out. tried use array , great, works thing makes separate arrays [0] , need 1 in same array not array() array() doing. so i'm using while() mysql_fetch_array results off database , depends on $_get url in-order grab correct id's. in url pass in api.php?do=remove&id=1,4,7 print out first id , not others name. said tried array() , came out : array ( [0] => bzlxo.jpg ) array ( [0] => chztk.jpg ) array ( [0] => 9yset.jpg ) array ( [0] => ss04v.jpg ) i don't understand why doing need in 1 array in array ( [0] => bzlxo.jpg, [1] => chztk.jpg, [2] => 9yset.jpg, [3] => ss04v.jpg ) so way when implode them show text in: "you removed image(s) "bzlxo.jpg,chztk.jpg,9yset.jpg,ss04v.jpg" like $iname[imagename] = array($iname[imagename]); $name = implode(",", $iname[image...

javascript - Different alternatives for making the Jquery Library work -

i wondering how make jquery library work. have of course research on before asking question, , have book suggest doing following: <script src="scripts/jquery-1.6.2.min.js"><script> however, reason, stuff on page not respond code this. confused. tried was, moving files working on same directory jquery-1.6.2.min.js, since jquery js library, didnt work. wondering be? have search syntax errors mad, reallllllyyyy doubt thats problem. wondering did wrong? other option can think of using website tag (which havnt tried yet): <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> </head> or <head> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery- 1.6.2.min.js"></script> </head> which wanted avoid because didnt want rely of being on web when work, never know... thanks! this full code wa...

html - How can I import eHarmony profiles with PHP? -

what method import profile information eharmony php if have username , password. i̢۪ve made apps importing facebook info websites using open graph system, don̢۪t know how eharmony, don̢۪t have developer features facebook. any suggestions appreciated! that not allowed tos

javascript - Div Slider Slideshow? -

i trying create slideshow similar 1 on lifeandtimes.com , , know best method so. have tried www.smoothdivscroll.com , many other solutions no avail. appreciated. there quite bit going on in example link. not going find plugin in 1 package. aspects of example looking mimic? you learn lot viewing site's javascript. looks 'mosaic' js file may happening.

iphone - cocos-2d:My app crashes when i close it via task manager -

i have weird problem,when close app via task manager , app gets crashed on line int retval = uiapplicationmain(argc, argv, nil, @"appdelegate"); throwing "thread : 1 signal sigkill" error,and can't reopen app @ all. other times works pretty well. please 1 me problem. new cocos-2d please gentle :( , thanks. as far know, normal, expected behavior. reason seems weird, think, when run xcode, executable attached debugger in xcode, prevents things executing (for example, in crash or sig_kill scenario). giving hint apple doing when use task-bar close app... sends sigkill process :-) edit: curious, tested little , found applicationwillterminate: not called first, encouraging consumer of apps. sigkilling these things. think means (with background-processing workflow) case when method called if opt out of background execution . news in order kill app way, need move background first, canonical place teardown applicationwillresignactive: but knew that... edit: in...

Ruby yield newbie issue -

i have started using ruby, quite new this. current objective use ruby module called retort, problem don't understand configure method looking this: def configure config = config.new yield config @@service = xmlrpc::client.new2(config.url) end config class simple , looks like: class config attr_accessor :url end i tried create small example play around in order understand how supposed work: class testclass def test_method config = string.new yield config p config end end d = testclass.new d.test_method { 'test string' } of course doesn't return 'test string' empty string. thank :) can clearer what's confusing you? code make sense you? class testclass def test_method config = yield p config end end d.test_method { "test string" } the yield statement invokes block. block returns string, assigned config variable in test_method , printed. make clearer? in code, line yield config invoking block while passing in just-instantiated config...

c - gdb: Program exited with code 030000000375 -

i teaching myself use gdb , running random tests. may worth mentioning using portable installation of mingw on windows 7 x64. i've created program know results in stack overflow, , run through in gdb first 2 sigsegv signals (no surprise), , exits (again no surprise) code 030000000375. program received signal sigsegv, segmentation fault. program received signal sigsegv, segmentation fault. program exited code 030000000375. curiosity getting best of me... heck code? googled , found little. thanks! update: reference tried same program on ubuntu, , results different: program received signal sigsegv, segmentation fault. program terminated signal sigsegv, segmentation fault. program no longer exists. gdb prints out exit code in octal format. not obvious, indicated leading 0 . so 030000000375 0xc00000fd in hex, makes code more common windows programmer. 0xc00000fd status_stack_overflow , should defined in ntstatus.h .

php - htaccess & WebsitePanel 404 error -

i've problem running website @ server websitepanel (1.2.1) , helicon ape module installed allow use of htaccess file. i enabled helicon ape module @ website properties panel htaccess doesn't works, server give me 404 error. someone knows problem? thanks. ok, i found problem. server owner doesn't had license in order. had trial license , period expired days ago. this all.

javascript - jquery select the next iframe -

html code <div style="width: 1000px;margin: auto" class="cf"> <div class="bo" data-href="../../link1">click</div> <div class="bo" data-href="../../link2">click 2</div> <div class="bo" data-href="../../link3">click 3</div> <iframe class='iframe hd' scrolling='no' frameborder='0'></iframe> <div class="bo" data-href="../../link1">click</div> <div class="bo" data-href="../../link2">click 2</div> <div class="bo" data-href="../../link3">click 3</div> <iframe class='iframe hd' scrolling='no' frameborder='0'></iframe> <div class="bo" data-href="../../link1">click</div> <div class="bo" data-href="../../link2">click 2</div> <iframe class='...

Should i use symfony or not -

i want make lite facebook version using symfony 1.4. had issues symfony , memory in past : is wise go symfony ? server requirements run smoothly (cpu, memory ...) ? thanks about memory more or less question how define "lite" ;) there ton of successful websites using symfony 1.4 (also big ones example delicious.com), believe question of scalability more how mature knowledge performance issues. what alternative approaches have in mind? writing own framework? strong advice use existing 1 instead (does not have sf1.4 though), work start implementing actual application logic done you. did habe @ symfony2? more modern framework quite stable (as 2.1 new forms component released soon) suggest using ;)

javascript - jQuery scrolling text on hover -

i have "a" element want scroll left on hover. remove first character , append end of string. how can continuously fire scroll function? mouse enters element -> scroll() fired until mouse leaves element or user clicks on it. html: <a href="foo.htm" class="scrollthis">this text scrolls on hover</a> jquery: $(".scrollthis").hover(function(){ scroll($(this)); }); function scroll(ele){ var s = $(ele).text().substr(1)+$(ele).text().substr(0,1); $(ele).text(s); } use setinterval() call repeatedly mouseenter, clearinterval() stop on mouseleave: var intervalid; $(".scrollthis").hover(function(){ var $this = $(this); intervalid = setinterval(function() { scroll($this); }, 100); }, function() { clearinterval(intervalid); }); note don't need use $(ele) in scroll() function because ele jquery object: function scroll(ele){ var s = ele.text().substr(1)+ele.text().substr(0,1); ele.text(s); } demo: http://jsfiddle....

html - PHP Function named after the Value of a Variable -

i have php function need create executes php or html code stored in variable. that's 1 problem. problem fact function created multiple times , need unique name i've named after $title i'm not sure if create function value of $title or if create function called $title or if won't work. code: $title = $_post['sogo_aso_name']; $output = $_post['sogo_aso_output']; some code here... function $title ($output) { //some code here execute $output... } so... that's problem. i'm not sure execute $output cleanly can shown on page. , don't know if function named after value of $title thanks help! ethan brouwer you can use call_user_func this: call_user_func($title, $output); but it's strange change name of 1 function.

javascript - sending JSON string from one HTML page to another -

i know might sound silly , easier alternative convert pages php. there way in html javascript or jquery? i want sending json string 1 html page another. in first.html there set of images gets converted json string looks this: {"images":[ {"src":"images/en1.png"}, {"src":"images/en4.png"}, {"src":"images/en2.png"}, {"src":"images/fr4.png"}, {"src":"images/b40.png"}, {"src":"images/ca7.png"} ]} i want send second.html , in there button called edit take first.html is there way or impossible? you use querystring that something like <a href='second.htm?images={"images":[ {"src":"images/en1.png"},{"src":"images/en4.png"},{"src":"images/en2.png"},{"src":"images/fr4.png"},"src":"images/b40.png"},{"src":"images/ca7.png...