Posts

Showing posts from February, 2014

cmd - Exit code "lost" from child process in Windows XP, not in Windows Server 2003 -

edit 3 ok, seems might not installer issue after all. when make simple batch file: exit /b 12 and call as cmd /c test.cmd echo %errorlevel% i "12" on windows server 2003 r2, "0" on xp. thought had tested simple test case many times before apparently not. so, i've changed tags , title i'm leaving other information here there's lot of useful stuff here not directly related issue. thoughts? original below i have custom action written in vbscript in turn calling windows batch file (the custom action allowing user execute @ install time can run later running batch file - it's convenience). function below: function mainfunction strcustomactiondata = session.property("customactiondata") strsplit = split(strcustomactiondata, ";") strinstalldir = strsplit(0) strpostcopyaction = strsplit(1) strscriptlocation = strinstalldir & "\migrationmasterprocess.cmd" strfullcommand = &q

css - Why do I need an empty `content` property on an ::after pseudo-element? -

this question has answer here: why :before , :after pseudo-elements require 'content' property? 4 answers i got http://jsfiddle.net/8p2wx/2/ previous question asked , see these lines: .cf:before, .cf:after { content:""; display:table; } .cf:after { clear:both; } if take away content:"" , ruins effect, , don't understand why it's necessary. why needed add empty content :after , :before pseudo-elements? you cannot style generated content without defining content should be. if don’t need content, “invisible element” style, can set empty string ( content: '' ) , style that. it’s easy confirm yourself: http://jsfiddle.net/mathias/yrm5v/ by way, snippet posted micro clearfix hack, explained here: http://nicolasgallagher.com/micro-clearfix-hack/ as second question, you’ll need an html5 shiv (

Is it possible for format a Excel Table adding data with Markers with SyncFusion XlsIO ASP.NET? -

i have excel file (that use template) 2 rows. first 1 table headers, , second 1 data markers (eg. %customer.name). 2 rows setted table in excel. when applymarkers, example 2 data rows created, first 1 part of table (with correct table formatting). excel table isn't "refreshed" include data rows added. this able extrememl doing : table.fill(reportdata, datasetname); is possible, without post processing after applying markers? thanks in advance, ricardo this feature not supported. to accomplish same result have fill data first , range want make table do: sheet.listobjects.create("table1", datarange);

asp.net - Update a child table in Entity Framework -

i have 2 tables in db: "competitions" , "competitionanswers". each competition have 3 answers. want able edit competition , competitionanswers same view. have managed view work using editor templates so editor template: @modeltype golfbug.answer <div class="editor-label left"> answer:<br /> </div> <div class="editor-field right"> @html.hiddenfor(function(model) model.competitionid) @html.hiddenfor(function(model) model.competitionanswersid) @html.editorfor(function(model) model.competitionanswer) </div> <div class="clear"></div> and view @modeltype golfbug.competition @code viewdata("title") = "edit" end code <h2>edit</h2> <script src="@url.content("~/scripts/jquery.validate.min.js")" type="text/javascript"> </script> <script src="@url.content("~/scripts/jquery.validate.unobtrusive.mi

ios - Mobile Safari Web App - clicks and gestures are rather unresponsive -

i have developed html5 web app ipad devices (mobile safari). seems me html buttons , click-events within app unresponsive compared buttons , gestures on native ios apps. has else noticed phenomenon? have words of wisdom on why happening, , how such buttons made more responsive? thanks. enabling css active pseudo styles in mobile safari makes clickable elements more responsive. , google has document: "creating fast buttons mobile web applications" says "touchend events fired no delay faster click events, there few problems consider:" didn't realize speed difference between click or tap events on ios. also performance depends on device, ios versions , prensentation type of web app (in safari, home-screen web-app, or in uiwebview) , affect responsiveness too. see performance charts @ http://thetechjournal.com/electronics/iphone/report-ios-5-browser-performance-test.xhtml

php - ms sql row_number() function - won't let me use within the same statement -

i have following sql statement: $sql = "select siteid, row_number() on (order siteid) rownum nwsite rownum >= 4"; "rownum" works when use name outside of query (e.g. in foreach loop) when comes using clause never works. any ideas? thanks because clause evaluated before window function row_number computed, can't include column in clause. you can structure query this: select siteid, rownum (select siteid, row_number() on (order siteid) rownum nwsite) nw rownum >= 4 in case inner query computed in entirety , passed outer query rownum column can acted upon.

R reshape data from long to wide and vice versa -

i wrote 2 wrapper functions cast , melt bring data long wide form , vice versa. however, still struggle function reshape_wide brings data long form wide form. here example functions plus code run it. created dummy data.frame in wide format reshape long format using reshape_long function , transform original wide form using reshape_wide function. however, reshaping fails reason cannot figure it. seems formula used in dcast wrong. reshape_long <- function(data, identifiers) { data_long <- melt(data, id.vars = identifiers, variable.name="name", value.name="value") data_long$value <- as.numeric(data_long$value) data_long <- data_long[!is.na(data_long$value), ] return(data_long) } reshape_wide <- function(data, identifiers, name) { if(is.null(identifiers)) { formula_wide <- as.formula(paste(paste(identifiers,collapse="+"), "series ~

sql server - How to change the output in 1 SQL column to be the same result in every row -

below sql statement: select glm_prft_ctr store, glm_account account, glm_group class, glm_description description, glm_amt_period0 + glm_amt_period1 + glm_amt_period2 + glm_amt_period3 + glm_amt_period4 balance gl_master_in glm_prft_ctr = 410 or glm_prft_ctr = 14101 , glm_series = 'fy12' group glm_account, glm_description, glm_prft_ctr, glm_group, glm_amt_period0, glm_amt_period1, glm_amt_period2, glm_amt_period3, glm_amt_period4 below result , prompted question: store account class description balance 410 36000 re retained earnings 396367.61 14101 36000 re retained earnings -20505.93 i need have result store 7410 rows returned. select 7410 store, glm_account account, glm_group class, glm_description description, glm_amt_period0 + glm_amt_period1 + glm_amt_period2 + glm_amt_period3 + glm_amt_period4 balance gl_master_in glm_prft_ctr = 410 or glm_prft_ctr = 14101 , glm_series = 'fy12'

odbc - Is there any way to get the leading interval precision for a column through DBI in Perl? -

i need able following column attributes in perl script column in odbc table : sql type precision scale interval leading precision typename whether signed or unsigned nullability whether it's case sensitive whether it's auto-unique updatability right i'm using dbi, , seems can most of information, i'm stumped getting interval leading precision. dbi expose this? that pod (which wrote) sqlcolattributes. happened ms deprecated sqlcolattributes , replaced sqlcolattribute. btw, there typo in pod should $sth not $dbh (i've fixed that). colattributes superceded dbi attributes in cases e.g., precision . cannot pass new sqlcolattribute types sqlcolattributes dbd::odbc knows ones odbc defined sqlcolattributes , odbc allowed driver-specific attributes (for dbd::odbc not possibly know type of) has trap them , issue "driver-specific column attributes not supported" message. see sqlcolattribute lists values can pass colattribute. you'l

use DOMParser or SAXParser from Nekohtml in android project -

i try use nekohtml parse html file. problem: when use domparser or saxparser, receive these messages: in console: trouble processing: dx bad utf-8 byte 80 @ offset 00000021 ...while parsing cst 0213 @ offset 00001732 ...while parsing cst 0053 @ offset 00000176 ...while parsing org/apache/xerces/impl/xpath/regex/token.class ...while processing org/apache/xerces/impl/xpath/regex/token.class trouble processing: [2012-03-07 18:50:32 - info] dx bad utf-8 byte a0 @ offset 00000004 ...while parsing cst 00c0 @ offset 00000909 ...while parsing cst 003b @ offset 00000106 ...while parsing org/apache/xerces/impl/xpath/regex/parserforxmlschema.class ...while processing org/apache/xerces/impl/xpath/regex/parserforxmlschema.class dx warning: ignoring innerclasses attribute anonymous inner class (org.apache.xerces.impl.xpath.xpath$1) doesn't come associated enclosingmethod attribute. class produced compiler did not target modern .class file format. recommended solution recompile cla

stored procedures - Using MIN(left(@prefix, 3)) in SQL -

i'm trying use min(left) in sql find prefix of id (for example want ujh ujh5433) @prefix varchar(25) select [description] prefix prefix = min(left(@prefix, 3)) when try execute alter procedure [dbo].[prefixinfo2] statement, sql doesn't seem min(left(@prefix, 3)) format. error message get: an aggregate may not appear in clause unless in subquery contained in having clause or select list, , column being aggregated outer reference. is there way min work? all need prefix of id left(@id, 3) . don't need min .

css - CSS3 radial background, is there a cheat for it? -

background: #008080; /* old browsers */ background: -moz-radial-gradient(center, ellipse cover, #008080 0%, #0896a5 100%); /* ff3.6+ */ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#008080), color-stop(100%,#0896a5)); /* chrome,safari4+ */ background: -webkit-radial-gradient(center, ellipse cover, #008080 0%,#0896a5 100%); /* chrome10+,safari5.1+ */ background: -o-radial-gradient(center, ellipse cover, #008080 0%,#0896a5 100%); /* opera 12+ */ background: -ms-radial-gradient(center, ellipse cover, #008080 0%,#0896a5 100%); /* ie10+ */ background: radial-gradient(center, ellipse cover, #008080 0%,#0896a5 100%); /* w3c */ filter: progid:dximagetransform.microsoft.gradient( startcolorstr='#008080', endcolorstr='#0896a5',gradienttype=1 ); /* ie6-9 fallback on horizontal gradient */ i want background webpage doesn't see

How to sort a complex PHP array -

i trying reorganize php array (on wordpress page). site coded else, , i'm trying make things better. think did things in confusing way (poor use of categories). rather recode entire site, wanted see if me work around fix. so, basically, have array inside array. list of categories, , each category has specific details. i'm calling categories, based on it's parent. need reorganize list/array of categories, can print out in order need them to. $cat_tree = get_category_parents(wt_get_category_id(), false, ':', true); $top_cat = split(':',$cat_tree); $parent = $top_cat[0]; $idobj = get_category_by_slug($parent); $args = array( 'child_of' => $idobj->term_id, 'orderby' => 'name', 'order' => 'asc', 'hide_empty' => 0); $counter_c=1; $categories = get_categories( $args ); if($counter_c == 1) $counter_c = '

Transforming text with 'sed' or 'awk' -

i have large input set looks this: label: foo, other text: text description... <insert label> item: item description... <insert label> item: item description... label: bar, other text:... <insert label> item:... label: baz, other text:... <insert label> item:... <insert label> item:... <insert label> item:... ... i'd transform pull out label name (e.g. "foo" ) , replace tag "<insert label>" on following lines actual label. label: foo, other text: text description... foo item: item description... foo item: item description... label: bar, other text:... bar item:... label: baz, other text:... baz item:... baz item:... baz item:... ... can done sed or awk or other unix tool? if so, how might it? one solution using sed : content of script.sed : ## when line beginning 'label' string. /^label/ { ## save content 'hold space'. h ## stri

php - Silent failure on move_uploaded_file and ZipArchive::Close -

update/possible solution: i've realized files being moved c:\windows\temp invisible due file permissions. if try access files via browser, 401 error. believe these files retaining original permissions , unable see them or mess them via php/browser. option change c:\windows\temp folder permissions or move default_upload_folder within wwwroot chain. -- i have iis7 server running php script accepts $_files , move_uploaded_file add files directory , zips files using ziparchive . both of these statements failing. here code logic: ini_set('display_errors',1); if(!empty($_files)){ $tempfile = $_files['filedata']['tmp_name']; $targetpath = 'c:\\inetpub\\wwwroot\\sitename\\design\\uploads\\'; $targetfile = $targetpath.$_files['filedata']['name']; $zip_file = $targetpath . htmlspecialchars($_post['session_id']) . '.zip'; move_uploaded_file($tempfile, $targetfile); $zip = new ziparchive;

c# wcf duplex communication -

i have write online chess program using wcf. i'm new service programming, please give me advice. i thought of using duplex communication, service poll database , call client, if opponent has made new step. don't think quite optimal solution. please tell me better alternatives can here? thanks lot. depends on type of clients use service. if example clients .net clients use wcf net.tcp communication , set callback contract clients need implement , service can call when makes move. if use other type of clients polling best way go.

razor - Setting up .NET 4.0 Environment -

i have got situation on server running applications support asp.net version 1.0 , 2.0. have developed application in asp.net 4.0 using mvc (razor engine). i wondering if install asp.net 4.0 on server, affect other websites running? if advise me on i'd appreciate it. no shouldn't sure, in iis configuration set right application pools. can set different app pool every aspx website/application. each pool can set different .net version.

SQL Server 2008 r2 high cpu usage -

we running photo sharing website in windows server 2008 r2 ent edition & sql server 2008 r2 ent edition. server configuration xeon 5620 48gb ram & 4 x 450gb 15k scsi hdd's. we have minimum 50 , max 500 active connections on db per last month average. average same. 1 month our sql server cpu usage less 1% it's using minimum 25% , upto 100% always. problem facing last 8 days. last 8 days anwards our cpu usage increasing when start sql service & when stop it's normal only. request can 1 tell me how solve problem. agreed tomtom, have bottom of it. guess lack/inaccurate indexing, results high cpu w/o high number of sessions. check information in dmv's ( careful though, they're hints sql engine, should analyzed trained professional ) : select migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) improvement_measure, 'create index [missing_index_' + convert (varchar, mig.index_group_handle)

java - JTextPane shows color different from browser of an HTML -

Image
i loading simple html page in jtextpane showing different color when viewed in browser, , div tag's height , width changed. the html file has 1 div tag nd is: <div height ="200" width="100" style="background-color:#0f9">this div tag </div> i calling setpage jtextpane . this how displayed in jtextpane this how should dislplayed(it firefox) i ran same problem. documented here (http://docs.oracle.com/javase/6/docs/api/javax/swing/text/html/css.html), can use background-color. value of has contain 7 characters, example background-color:#00ff99;

javascript - Sorting, updating and presenting async response data in a HTML table -

i've got app issues multiple async calls backend; each async response array of {date, string} values. i'd present responses of each of these async calls arrive, in sorted table in web browser (ordered date). subsequent responses other async calls arrive, want sorted table updated in real time. for example, first async response might [{'2012-02-10', 'abc'}, {'2012-01-19', 'def'}, {'2012-03-01', 'ghi'}] , , i'd want see <table><tr><td>2012-01-19</td><td>def</td></tr><tr><td>2012-02-10</td><td>abc</td></tr><tr><td>2012-03-01</td><td>ghi</td></tr></table> rendered in browser immediately. if second async response of [{'2011-12-09', 'jkl'}] appears time later, want html changed <table><tr><td>2011-12-09</td><td>jkl</td></tr><tr><td>

.net - give focus to datagrid after button is clicked -

i have button , datagrid. located on same window. need give focus selected row after button clicked. seems not straightforward i've thought. so i've got datagridrow object. call datagridrow.focus(), focus still there. after reading incredible topic i've tried using focusmanager loose focus on button, tried settings button.isfocusable = false , setting true again. tried giving focus row using this: var scope = focusmanager.getfocusscope(mydatagrid); focusmanager.setfocusedelement(scope, row); but didn't help. not understand how focusmanager works enough. give me clue how give focus row? row.focusable = true; row.focus();

SQL Server stored procedure - SELECT statement then use results in INSERT statement -

i writing stored procedure results 1 table copy them another. isn't exact match, i'm changing 1 column , ignoring another. there 5 columns , on average 3-5 results if relevant. i need to: select * sometable somecolumn = 1 then every result insert anothertable (a,b,c) values (@a, @b, @c) what best way within stored procedure? you can in 1 statement: insert anothertable (a, b, c) select a, b, c sometable somecolumn = 1 wherever possible, avoid doing things in loops/cursors/rbar (row agonizing row) , instead try think in set-based approaches above.

java - Test other Activity in different package declare in manifest file -

i have issue, don't know how solve this: have 2 package, example packagea (there many classes inside, example classa ) , packageb (same, there many classes inside, example classb ). in android manifest file , declare com.packagea , each files in com.packageb , must use : import com.packagea.r; . now, want test on classb ( classb activity), how can ? i have 1 solution rename again, packagea packageb , vice versa. but, think handy. who has solution, please tell me. thanks :) no need rename of class call classes along package name per below <activity android:screenorientation="portrait" android:configchanges="orientation|keyboardhidden" android:name="com.package1.classname" android:theme="@android:style/theme.notitlebar" /> <activity android:screenorientation="portrait" android:configchanges="orientation|keyboardhidden" android:name="com.package2.c

node.js - client not handshaken client should reconnect, socket.io in cluster -

my node.js app express, redis, mongo , socket.io works prefectly. today when introduced cluster, found works, there lot of messages app, 'client not handshaken' 'client should reconnect' many times response time socket.io bad, several seconds. then used http-proxy front ending requests browsers. chrome works intermittently without throwing such messages. if open same url again, starts throwing these messages , response delayed. firefox behaves same way. randomly, starts throwing these messages continuously.. looks problem websocket in clustered environment. my node.js version 0.6.10, socket.io 0.9.0, express 2.5.9, http-proxy 0.8.0 this because socket.io keeps connections in memory, each server have it's own set of clients. share socket.io on multiple server instances, using redisstore . same applies express sessions, have connect-redis option.

drupal - Prefixing the pathauto structure with a country code -

my client wants site localised, example.com/uk presents uk version, example.com/aus australian version etc etc. however, want actual content, , nodes delivered, remain , basic path structure not change- prefixed country code. of course want 'switch country' button, automatic redirections based on geoip etc, want focus on path structure. however, still want country selected available within views, content types, template files etc, uk/products/chairs , aus/products/chairs still aliases of node/1 supplied session/cookie/variable set 'uk' or 'aus'. does know way of doing please? google hasn't supplied knowledge :/ many fanks! :) if you're on drupal 7, go admin/config/regional/language , click "edit" each language allow set "path prefix language code." append phrase of choosing after domain , before drupal path requested. the "switch country" button can found on blocks page "language switcher" block

CSS- link to an icon visible on hover -

i have icon display on top, right of div on hovering on div. code this: <div class='edit_hover_class'> <!-- code --> </div> and corresponding css file contains: .edit_hover_class:hover { background: url("trash.gif") no-repeat scroll right top; } i want attach link edit icon, possible plain css? if so, how? you hide link until hover so: <div class='edit_hover_class'> <a href='#'><img src='icons/trash.gif' /></a> </div> .edit_hover_class a{ visibility:hidden; } .edit_hover_class:hover { visibility:visible; } see jsfiddle: http://jsfiddle.net/auzm5/ or if want icon link, use css visibility : http://jsfiddle.net/auzm5/1/

spring - ActiveMQ maven plugin configuration -

i have problem using activemq in spring project. trying integrate activemq maven plugin project use in integration tests. here configuration: <?xml version="1.0" encoding="utf-8"?> <!-- licensed apache software foundation (asf) under 1 or more contributor license agreements. see notice file distributed work additional information regarding copyright ownership. asf licenses file under apache license, version 2.0 (the "license"); may not use file except in compliance license. may obtain copy of license @ http://www.apache.org/licenses/license-2.0 unless required applicable law or agreed in writing, software distributed under license distributed on "as is" basis, without warranties or conditions of kind, either express or implied. see license specific language governing permissions , limitations under license. --> <!-- start snippet: example --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns

What is the best utility/library/strategy with Python to copy files across multiple computers? -

i have data across several computers stored in folders. many of folders contain 40-100 g of files of size 500 k 125 mb. there 4 tb of files need archive, , build unfied meta data system depending on meta data stored in each computer. all systems run linux, , want use python. best way copy files, , archive it. we have programs analyze files, , fill meta data tables , running in python. need figure out way copy files wuthout data loss,and ensure files have been copied successfully. we have considered using rsync , unison use subprocess.popen run them off, sync utilities. these copy once, copy properly. once files copied users move new storage system. my worries 1) when files copied there should not corruption 2) file copying must efficient though no speed expectations there. lan 10/100 ports being gigabit. is there scripts can incorporated, or suggestions. computers have ssh-keygen enabled can passwordless connection. the directory structures maintained on new server, sim

java - How to empty specific char array positions -

i have 200-elements-long char array, load vector new characters in loop, , @ each cycle element number can different previous one, how can empty unwanted position of array? note: element size have of 200 , can't resolve problem creating new instance of object new. thanks do mean like: arrays.fill(array, index, array.length, '\0'); ? of course, overwrite rest of array u+0000 values... there's no such thing char[] element being "empty". there always char @ every element in array; u+0000 one way of indicating "don't treat real data".

ruby on rails - How to center table in prawn? -

i have created table in prawn , wanted pass :position option whih documented in manual throws off method_missing error. seems parameter doesnt exist anymore. how can center table in prawn? i ran same error. installing master on github fixed issue. # gemfile gem 'prawn', git: 'https://github.com/prawnpdf/prawn.git' issue thread on github

Benefits of declaring variable type through assignment in JavaScript -

in javascript, there benefit in assigning temporary value newly declared variable? example... var = 0, b = ''; // somewhere else = 5; b = 'goodbye'; vs var a, b; // somewhere else = 5; b = 'goodbye'; i'm aware assigning variable on declaration set type. in javascript, can changed assigning value of different type, doesn't protect in way. what advantages/disadvantages of above? i believe advantage is: order in code. you'll know right beginning of code type var. the disadvantage more code lines , size of file.

c# - How do I get the CanXXX behavior for drop down selection in Caliburn.Micro? -

if have button named execute, can write method control button's clickability: public bool canexecute() { return !string.isnullorwhitespace(this.selectedcatalogname) && !string.isnullorwhitespace(this.selectedcommandname); } similarly, have dropdown named selectedcommand should disabled until dropdown selected: private bindablecollection<string> catalognames; public bindablecollection<string> catalognames { { return this.catalognames; } } private string selectedcatalog; public string selectedcatalogname { { return this.selectedcatalog; } set { this.selectedcatalog = value; this.notifyofpropertychange(() => this.selectedcatalogname); } } // ----------------------------------------------------------------- // --> can or equivalent? // ----------------------------------------------------------------- public bool canselectcatalogname() { return !string.isnullorwhitespace(this

flash - Should I use BlazeDS for this? -

i have flash project polls php server every 10 seconds check commands. have 1200 machines running on local network. when have network slowdowns, polling fails , project hangs. blaze/livecycle behaved on thin networks? more robust polling under these conditions? it's not polling (or pushing) part make blazeds better/faster. make better (probably) if use blazeds , send data when necessary, , necessary -- limiting overall traffic. sounds polling hangs because @ point in time end sending lot of data , takes flex while injest data. i've run simulations 8000 entities pushing state (an object ~20 string fields , 2-3 large lists of strings) flex via blazeds , performance ok.

php - Why this query doesn't works -

i not confirmed query... feel somewhere cu or ci has been misplaced... query worked without using $db->namequote in sql. $query = 'select '. $db->namequote(cu.'id') .' '. $db->namequote('#__users'), $db->namequote('#__community_cinvit' ci) .' '. $db->namequote(cu.'email').'='.$db->quote(ci.'to_email') .'and'. $db->namequote(ci.'point_given').'='.$db->quote('1'); $db->setquery($query); $conn = $db->loadresult(); echo $conn; is there error in cu , ci add white space before .' and'. , add cu $db->namequote('#__users' cu) $query = 'select '. $db->namequote(cu.'id') .' '. $db->namequote('#__users' cu), $db->namequote('#__community_cinvit' ci) .' '. $db->namequote(cu.'email').'=&

ASP.Net: Showing buttons only to logged in users -

i want show few buttons users logged in. don't use membership provider session. can still somehow use loggedintemplateor should other way? i store session user in onlogin button event: sqlcommand query = new sqlcommand("select count(*) admin username='"+username.text+"' , password='"+password.text+"'", conn); conn.open(); int result = (int)query.executescalar(); conn.close(); if (result > 0){ session["loggedin"] = true; session["user"]=username.text; } else session["loggedin"] = false; then try create button if user logged in: if ((bool)session["loggedin"]==true)) button_dodaj_oglas.visible = true; else button_dodaj_oglas.visible = false; but objject not set instance (concerning session). wtf? you can use session store loggedin-status although not recommend it, because session is not authentication . bool loggedin

Change facebook social discovery description -

this seems simple question, can't figure out. developed facebook game. when playing game the message loves appearing in stream: some guy playing awesome game ever. and after that, description, root of problem. i'd change description, @ moment showing ... facebook social utility connects people friends , others work, study , live around them. people use facebook keep friends, upload unlimited number of photos, post links , videos, , learn more people meet. does know can change text? helpful if tell me term text is, research on own. //edit: ok, term particular fb post social discovery or usage stories , unfortunately didn't me find out how can change description of post. remaining question.

java - Unable to download ADT Plugin for Eclipse Indigo 3.7.2 -

i'm using eclipse indigo (ver 3.7) on win 7 (64 bit). have been trying download adt plugin past 2 days unable so. i've tried both https , http versions of https://dl-ssl.google.com/android/eclipse/ no avail. downloaded .zip file adt plugin locally , tried kept saying 'org.eclipse...wst.o.o.o' not found. correct problem suggested some, tried update indigo initial download of contents.jar repository timing out. following error: some sites not found. see error log more detail. unable read repository @ http://download.eclipse.org/releases/indigo/201106220900/content.jar . read timed out unable read repository @ file:/c:/eclipse/p2/org.eclipse.equinox.p2.repository/cache/content-2092920409.jar. premature end of file. please help! p.s.: have tried running eclipse administrator. i had same problems. tried solutions ran sudo eclipse in ubuntu; normal method , worked.

In jquery UI drop effect, how can I find the being dragged element? -

in jquery ui drop effect,how can find being draged one? $('#test').droppable({ drop: function (e,ui) { //$(this) means drop-container //how can use "ui" parameter find being draged one? } } }); like ui.? thank you ui.draggable element being dragged. drop (event) event triggered when accepted draggable dropped 'over' (within tolerance of) droppable. in callback, $(this) represents droppable draggable dropped on. ui.draggable represents draggable . documentation $('#test').droppable({ drop: function (e,ui) { // "ui.draggable" dragged element (as jquery object) ui.draggable.addclass('myclass') } });

mod rewrite - How to debug Apache mod_rewrite -

Image
i have 2 main problems mod_rewrite: 1) there no meaningful error reported when have invalid rule 2) reliably test each modification, have erase chrome's cache. isn't rocket science, have hit ctrl+shift+delete click ok, close window, , reload. i'd see if of gurus willing share secrets efficiently managing mod_rewrite code. one trick turn on rewrite log. turn on,try these lines in apache main config or current virtual host file ( not in .htaccess ): rewriteengine on rewritelog "/var/log/apache2/rewrite.log" rewriteloglevel 3 since apache httpd 2.4 mod_rewrite rewritelog , rewriteloglevel directives has been replaced new per-module logging configuration. loglevel alert rewrite:trace6

indexing - SQL Server : For 3 columns, difference between "one index per column" / "one index for all" -

i configuring simple table in sql server. named "log" , might expect, used record logs, later monitoring/searching/grouping use of various applications in various manners. the table declared (simple syntax) : log { user varchar(8), timestamp datetime, appname varchar(16) } primary key(user,timestamp,appname) should index each column in separate index? 3 in same index? clustered / non-clustered? i'd happy see logic/knowledge apply here. i'd suggest making timestamp clustered index... since clustered index particularly efficient on columns searched ranges of values , , seems describe how querying data. additionally, i'm assuming timestamp sequential, make inserting new data clustered index less expensive if there random distribution of data being inserted. it doesn't sound searching user or appname , wouldn't recommend adding indexes columns unless plan on joining on these values or using them in where clause somewh

scanf - fscanf usage in C -

i have file this: 10 15 i want read tree variables, let's number1, number2, , mystring. have doubts kind of pattern give fscanf. thinking this; fscanf(fp,"%i %i\n%s",number1,number2,mystring); should work, , also, correct way of reading file? if not, suggest? read each line fgets (or getline if have it), split line strsep (better, if available) or strtok_r (more awkward api more portable), , use strtoul convert strings numbers necessary. *scanf should never used, because: some format strings (e.g. bare "%s" ) eager overflow buffers gets is. behavior on integer overflow undefined -- invalid input can potentially crash program. they not report character position of first scan error, making nigh-impossible recover parse error. (this can mitigated using fgets , sscanf instead of fscanf .)

WCF Service class static constructor called in every call -

i have service class implementing contract follows: interface icontractfoo { void foo(); } class servicefoo() : icontractfoo { public static servicefoo() { log("static constructor called"); } void foo() { log("foo called"); } } what finiding each time foo api called, static constructor gets called. so, log looks - static constructor called foo called static constructor called foo called this should not happening since static constructor. idea going wrong? thanks help by default, wcf services use "per-call" model. don't think marking constructor static change behavior. can change using servicebehavior attribute or changing servicebehavior settings in web.config file associated service. here couple articles might decide model appropriate services: http://msdn.microsoft.com/en-us/magazine/cc163590.aspx http://www.codeproject.com/articles/86007/3-ways-to-do-wcf-i

sql server - Linq performance: Two queries, the first response immediately and the second is very slow -

i have 2 queries similars, using linq executequery method first take 30 seconds, while second query inmediate. i execute queries in microsoft sql server management studio , 2 queries have response time of 0 seconds. query 1 (slow) ienumerable<viewdatatanksdatadevice> res= this.executequery<viewdatatanksdatadevice>( "select top 1 * viewdatatanksdatadevicessb id_tank = {0} , date >= {1} order date", new object[] { tankid, date }); query 2 (fast) ienumerable<viewdatatanksdatadevice> res= this.executequery<viewdatatanksdatadevice>( "select top 1 * viewdatatanksdatadevicessb id_tank = {0} , date <= {1} order date desc", new object[] { tankid, date }); note 1: viewdatatanksdatadevicessb view schema binding, , has 2 index index 1(id_tank, date asc) index 2(id_tank, date desc) note 2: if execute first second query result identical: query1 slow , query 2 fast. note 3: view have millions of registers,

html - Show Multiple Checkboxes in Columns -

i wondering best way following is: (i cannot post pictures since new, here's link screencast) multiple html checkboxes http://www.screencast.com/t/zcgnm3fka i need include in registration form, , wondering best way code is. know can use html table, not sure if that's best approach because other questions #3 in picture not require more 1 column. if chose html table option, following mark appropriate? <table width="70%" cellspacing="3" cellpadding="3"> <tr><td>1.) question goes here?</td></tr> <tr> <td> <label>watches</label><br /> <input type="checkbox" class="all" /> </br> <input type="checkbox" class="all" />something </br> <input type="checkbox" class="all" />something </br> <input type="checkbox" class=&qu

html - Unable to get navigation bar inline with logo -

i'm trying navigation bar on html page inline logo wont budge. assume because following flow of html page, dont want use absolute positioning, did try , use 'left' , 'top' properties in css didnt it. please advise i'm going wrong? please see example here: demo of problem p.s. red me see going on. there quite few errors html structure, unclosed tags, , odd placement of elements. have reworked code see example works modern browsers. it's not cleanest code should on right path. http://jsfiddle.net/lj9yn/18/

iphone - UISearchBar detect when user stop type and don't search immediately so detect pause -

i'm searching implementing uisearchbar retrieve information url, , default method: - (void)searchbar:(uisearchbar *)searchbar textdidchange:(nsstring *)searchtext{ i can detect when text change , perform fetch of url, in way, text type slow because iphone searching url, want start fetching of url when user stop writing second, want detect pause of typing refresh table view retrieving information url. have found older post of request , have tried solution me don't work: - (void)searchbar:(uisearchbar *)searchbar textdidchange:(nsstring *)searchtext { [nsobject cancelpreviousperformrequestswithtarget:self selector:@selector(request:) object:searchtext]; //..... [self performselector:@selector(request:) withobject:searchtext afterdelay:1.5]; } -(void)request:(nsstring *)mystring { nslog(@"%@",mystring); } in way when i'm typing request method not called when stop typing it's called every character type, same of default method,

objective c - Variable return runtime error -

i making iphone app cocos2d , everytime try return variable function run time error on code below... gb2shapecache *cache = [gb2shapecache sharedshapecache]; //exc_bad_access run time error here *eggfixture = [cache addfixturestobody:body forshapename:@"egg3"]; i don't know doing wrong... here code addfixturestobody... -(b2fixture) addfixturestobody:(b2body*)body forshapename:(nsstring*)shape { bodydef *so = [shapeobjects objectforkey:shape]; assert(so); b2fixture *fixi; fixturedef *fix = so->fixtures; while(fix) { fixi = body->createfixture(&fix->fixture); fix = fix->next; } return *fixi; } and here define variable eggfixture b2fixture *eggfixture; and here try use b2fixture eggfixture later for(pos = _contactlistener->_contacts.begin(); pos != _contactlistener->_contacts.end(); ++pos) { mycontact contact = *pos; if ((contact.fixturea == loca

Converting a code from bash to php -

i have existing code in bash greps keyword config file: [user1] usrcid = 5654654654 usrsid = xdfdfsas22 usrmid = companyname1 usrsrt = secret1 urlenc = http://www.url1.com [user2] usrcid = 5654654667 usrsid = xdfdfsas45 usrmid = companyname2 usrsrt = secret2 urlenc = http://www.url2.com i store variable , use processing rest of script. want achieve convert behavior bash php , curl: f1=/etc/config/file.txt cid=`grep "\[user1\]" -a 5 $f1 | grep usrcid | awk {'print$3'}` sid=`grep "\[user1\]" -a 5 $f1 | grep usrsid | awk {'print$3'}` mid=`grep "\[user1\]" -a 5 $f1 | grep usrmid | awk {'print$3'}` srt=`grep "\[user1\]" -a 5 $f1 | grep usrsrt | awk {'print$3'}` uri=`grep "\[user1\]" -a 5 $f1 | grep urlenc | awk {'print$3'}` echo $cid $sid $mid $srt $uri i'm not php guru please excuse code below general perspect

ios - XCode 4.3.1 breaks validation of apps with directories added by reference. Any workaround? -

i've discovered xcode 4.3.1 has serious issue validating apps resources within directory tree inside application bundle. apps can pass validation within xcode "build archive" process - fails when validation run via organizer, required save ad hoc or app store submittal. after spending hours trying trace down usual code signing entitlement issues, noticed following line in system console when export fails: 3/10/12 2:32:48.450 pm [0x0-0x261261].com.apple.dt.xcode: /users/chris/library/developer/xcode/archives/2012-03-10/coverage 3-10-12 2.32 pm.xcarchive/products/applications/coverage.app/tiles/t-mobile-roam/4: directory the "tiles" directory has been added project via "create folder reference added folders". i discovered removing tiles directory allows app build , validate. adding results in code sign failure. it seems adding multi-level directory tree screws validation process, , error messages send developers on wild goose chase tryin