Posts

Showing posts from July, 2013

sql - Check single column for multiple values mysql -

i have table 'optionsproducts' having following structure , values id optionid productid 1 1 1 1 2 1 1 3 1 1 2 2 1 2 3 1 3 3 now want extract productids against both optionid 2 , optionid 3 assigned. means in case productid 1 , 3 should returned. not sure missing. appreciated. to productid s relate both 2 , 3 optionid s, can write similar query: select productid ( select productid , optionid , dense_rank() over(partition productid order optionid) rn t1 optionid in (2,3) ) s s.rn = 2 result: productid ---------- 1 3 sqlfiddle demo

c# - Why are there the gaps between shapes in wpf -

i try draw rectangles side side,but there gap perhaps 1 pixel between the rectangles. better after set rectangle's snapstodevicepixels =true or uselayoutrounding = true,but after resize window,the gaps still occur. here code drawing rectangle. protected override void onrendersizechanged(sizechangedinfo sizeinfo) { base.onrendersizechanged(sizeinfo); drawrectangle(); } private void drawrectangle() { var width = this.grid1.actualwidth; var height = this.grid1.actualheight; var step = width / 15; this.grid1.children.clear(); (int = 0; < 15; i++) { rectangle rectangle = new rectangle(); rectangle.width = step; rectangle.height = height; rectangle.horizontalalignment = system.windows.horizontalalignment.left; rectangle.margin = new thickness(i * step, 0, 0, 0); rectangle.fill = new solidcolorbrush(colors.blue); ...

dom - Remove all elements before a specified ID attribute using pure javascript -

i'm using web service query ticketing interface , pull support tickets open @ point in time, displaying them in nice neat table within iframe part of our web application. application written in pl/sql use construct html pages , content displayed within iframe. main issue because tickets made of email content, there lot of useless rubbish (mostly tags) , irrelevant text included @ top of email content causes interface trashy. within code wrapping main areas of content require in table id of "ticketstable" , remove elements or content within iframe occurs before tickets table. usually use jquery task: $("#earliercontent").nextuntil("#ticketstable").andself().remove(); however, our system built using extjs wish avoid potential conflict jquery library cause environment. therefore need way process , loop through contents of iframe, removing elements , text occur before tickettable id therefore eradicating of unnecessary content. i've trie...

vb.net - Using Array.Copy in 2d Array -

i have 2 dimensional array. like, (0,1) (0,2) (0,3) (1,1) (1,2) (1,3) (2,1) (2,2) (2,3) how can use array.copy copy 2nd index in new array. only, (2,1) (2,2) (2,3) or there other way.

ios - getting video thumbnails from vimeo -

in app want display videos uploaded particular user in vimeo account. have completed oauth steps , got video_id's of video's uploaded user. tried download thumbnails videos can displayed in table view or collection view. vimeo has provided api method using got response this: nsurl *url = [[nsurl alloc] initwithstring:@"http://vimeo.com/api/rest/v2?format=json&method=vimeo.videos.getthumbnailurls&video_id=72961770"]; but pasted user id there. tried approach user id loaded dynamically. nsurl *url = [[nsurl alloc] initwithstring:@"http://vimeo.com/api/rest/v2?format=json&method=vimeo.videos.getthumbnailurls"]; oamutableurlrequest *request = [[oamutableurlrequest alloc]initwithurl:url consumer:consumer token:token realm:nil signatureprovider:nil]; oarequestparameter *p0 = [[oarequestparameter alloc] initwithname:@"video_id" value:[array objectatindex:0]]; nsarray *params = [nsarray arraywithobject:p0]; [reques...

javascript - Show div when google map is used -

i'm using google map api in rails app , show div jquery when using map. the map contained in div id search_map_container tryed $('#search_map_container').click(function() { $('#my_div').show(); }); but fail. , fail .focus() , .focusin() , .mouseenter() or .change() events. for putvande : html simple div : <div id='my_div' style='display:none;'> test </div> and google map html generate google : <div class="search_map_container"> <div id="search_map" class="gmaps4rails_map" style="position: relative; background-color: rgb(229, 227, 223); overflow: hidden; -webkit-transform: translatez(0);"><div style="position: absolute; left: 0px; top: 0px; overflow: hidden; width: 100%; height: 100%; z-index: 0;"> ... google map code ... </div> </div> for bharat soni : mean when click on google map or scroll or zoom. your co...

Android's SSLServerSocket causes increasing native memory in the App, OOM -

background i developing android app provides simple http/https server. if https serving configured on every connection increasing native memory usage observed leads app crash (oom), while using http configuration keeps native memory usage relative constant. app's java vm keeps relative constant in both configurations. the app serves html page contains javascript periodic polling (one json poll every second), calling app page using https configuration , keeping page open several hours lead mentioned out-of-memory because of increasing native memory usage. have tested many sslserversocket , sslcontext configurations found on internet no luck. i observe same problem on various android devices , various android versions beginning 2.2 4.3. the code handling client requests same both configurations http/https. difference between 2 configurations setup of server socket. while in case of http server socket 1 single line similar "serversocket serversocket = new serversocket...

json - Xively ParserUtil API -

i trying use parserutil deserialize , serialize xively data objects such datastream , datapoint. while tojson function works perfectly, can't toconnectedobject , toconnectedobjects function working. the following code excerpt , corresponding log. string jsondp=parserutil.tojson(false, dp); datapoint dpnew=parserutil.toconnectedobject(jsondp, datapoint.class); logger.debug(parserutil.tojson(false, dpnew)); log: 2013-08-28 11:45:31,348 2064 debug [parserutil.java: 136] (main:) parsing models json 2013-08-28 11:45:31,376 2092 debug [parserutil.java: 187] (main:) parsed json models: {"datapoints":[{"at":"2012-02-19t00:00:02.283064z","value":"261"}]} 2013-08-28 11:45:31,376 2092 debug [parserutil.java: 221] (main:) parsing string object: {"datapoints":[{"at":"2012-02-19t00:00:02.283064z","value":"261"}]} 2013-08-28 11:45:31,377 2093 debug [parserutil.java: 136] (ma...

maven 3 - Why does jboss-as:deploy fail? -

i wanted deploy war file jboss 7.1.1 after compilation. fails following line in output (setting maven debug output -x , -e not create more verbose output). my maven command use invoke is: clean install -pintegration jboss-as:deploy [info] --- jboss-as-maven-plugin:7.1.1.final:deploy (default-cli) @ webapp --- aug 28, 2013 11:58:26 org.xnio.xnio <clinit> info: xnio version 3.0.3.ga aug 28, 2013 11:58:26 org.xnio.nio.nioxnio <clinit> info: xnio nio implementation version 3.0.3.ga aug 28, 2013 11:58:26 org.jboss.remoting3.endpointimpl <clinit> info: jboss remoting version 3.2.3.ga mojofailed org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.final(default-cli) projectfailed com.foo:webapp:0.0.1-snapshot [hudson] archiving c:\users\administrator\.hudson\jobs\ccms\workspace\pom.xml c:\users\administrator\.hudson\jobs\ccms\modules\com.foo$webapp\builds\2013-08-28_11-57-43\archive\com.foo\webapp\0.0.1-snapshot\pom.xml [hudson] archiving c:\users\administrator\.hudson\...

How to use a returned PHP array inside an array itself? -

i create php array, of elements replaced elements of array returned function. example, create following array: $aarray = array( 0x01, 0x10, foo(1234), 0x03, foo(445), ... ) here, foo function returning simple php array. is, of course, like ( [0] => 1 [1] => 16 [2] => array ( [1] => 2 [2] => 4 ) [3] => 03 [4] => array .... but want include returned values function directly array, create like: ( [0] => 1 [1] => 16 [2] => 2 [3] => 4 [4] => 03 [5] => 3 .... is possible in simple way, without having construct array array_merge ? p.s: above example not working example, showing want do. content of function foo irrelevant. this closest thing can match need $aarray = array_flat( 0x01, 0x10, foo(1234), 0x03, foo(445) ); and here code array_flat . function a...

java - string comparing doesn't return right answere -

i want compare 2 strings eachother compareto() function. example: int result = "650".compareto("651"); if(result < 0){ system.out.println("smaller"); } else if(result > 0){ system.out.println("bigger"); } else { system.out.println("equals"); } system.out.println(result); this output smaller correct. example 2: int result = "650".compareto("1000"); if(result < 0){ system.out.println("smaller"); } else if(result > 0){ system.out.println("bigger"); } else { system.out.println("equals"); } system.out.println(result); this return output bigger. kinda strange 650 number smaller 1000. how's , how can change it? (yes numbers need in text format). i want this: int result = "650/65".compareto("1050/50"); if(result < 0){ system.out.println(...

apache - Using .htaccess to serve root domain content from subdomain -

i have php app requires domain's document root set /(wherever)/app_dir/www run (which can't changed, sadly). unfortunately, on host can't change document root main mydomain.com (from /public_html /public_html/app_dir/www can edit document root subdomains. subdomains stored in /public_html/subdomain.domain.com , , setting root subdomain /public_html/subdomain.domain.com/app_dir/www allows app display content fine @ http://subdomain.domain.com/ . in order have content appear @ root domain (where can't install since document root uneditable), i'm trying use .htaccess serve content subdomain without redirecting browser, going www.domain.com show www.domain.com in location bar, serving contents of subdomain.domain.com (and likewise www.domain.com/something pulling instead subdomain.domain.com/something ). as understand it, mod_proxy should able (and installed). based on other answers similar queries, looks should solution: rewriteengine on rewriteru...

ruby - Trying to understand GOD rb -

Image
i'm facing few confusion god documentation firstly configuration script directory = "/users/joshianiket22/myproject/god_script" god.pid_file_directory = directory god.watch |w| w.name = "mess" w.start = "ruby /users/joshianiket22/myproject/god_script/simple.rb" w.pid_file = file.join(directory,'simple.pid') puts file.join(directory,'simple.pid') w.stop = "ruby -e 'puts \"#{datetime.now}\"'" w.log = file.join(directory,'god.log') w.behavior(:clean_pid_file) w.interval = 10.seconds w.start_if |start| start.condition(:process_running) |c| puts "inside start condition" c.interval = 5.seconds c.running = false end end end confusion 1 : god pid file dilemma in god documentation mention now have clear have set pid_file , pid_file_directory yet pid no seen in directory define in configuration fyi, started god sudo assuming di...

c# - local bitmapimage(windows phone) -

i trying convey path <image x:name="flagimage" stretch="none" /> , when run application image not displayed. flagimage.source = new bitmapimage(new uri("/images/sky.jpg")); if change path url image displayed flagimage.source = new bitmapimage(new uri("http://www.charlespetzold.com/media/hellowp7.jpg")); this code work too: <image source="/images/sky.jpg"/> you have initialize bitmapimage urisource setting path relative..like this flagimage.source = new bitmapimage(new uri("/images/sky.jpg", urikind.relative)); hope helps you..

neo4j - Cypher Query to find out my followers and users i follow? -

hi relations i---follows----someone, someelse---follows----me , cypher query ? problem im not able figure out end node . there no directions specified in questions hope guessed them right, if not, modify needed: find follow: start n=node(yournodeid) match n-[:follows]->person return person; find follows you: start n=node(yournodeid) match person-[:follows]->n return person; hope helps!

input - If clicking something else - change prop / jQuery -

if clicking else, last input (which clicked) should readonly -> true again. here code: <script> $(document).ready(function() { $("input").prop("readonly", true); $("input").click(function() { $(this).prop("readonly", false); }); }); </script> thanks! try this --to make input editable on click $('input').bind('click', function () { $(this).prop("readonly", false); }); --to make input readonly on lost focus $('input').bind('blur', function () { $(this).prop("readonly", true); });

unix - to insert line breaks in a file whenever a comma is encountered-Shell script -

i need write shell script re-format file inserting line breaks. condition line break should inserted when encounter comma in file. for example, if file delimiter.txt contains: this, file, should, added, a, line break, when find, comma. the output should be: this file should added line break when find a comma. can done grep or awk ? using gnu sed : sed 's/, /\n/g' your.file output: this file should added line break when find a comma. note: syntax above work on system have \n line delimiter linux , unixes. if need portal solution in a script use following expression uses literal new line instead of \n : sed 's/,[[:space:]]/\ /g' your.file thanks @edmorten advice.

linq - Inconsistent behavior of python generators -

the following python code produces [(0, 0), (0, 7)...(0, 693)] instead of expected list of tuples combining of multiples of 3 , multiples of 7: multiples_of_3 = (i*3 in range(100)) multiples_of_7 = (i*7 in range(100)) list((i,j) in multiples_of_3 j in multiples_of_7) this code fixes problem: list((i,j) in (i*3 in range(100)) j in (i*7 in range(100))) questions: the generator object seems play role of iterator instead of providing iterator object each time generated list enumerated. later strategy seems adopted .net linq query objects. there elegant way around this? how come second piece of code works? shall understand generator's iterator not reset after looping through multiples of 7? don't think behavior counter intuitive if not inconsistent? as discovered, object created generator expression iterator (more precisely generator-iterator ), designed consumed once. if need resettable generator, create real generator , use in loops: def multiples_of_...

xcode4.5 - Can't select any items from the left pane of Xcode Organizer -

i having strange problem xcode. don't know how appeared. in organiser window of xcode, can switch between tabs devices, repositories, archives, documentation etc. in every tab, top item of left pane selected. example, in repository tab, repository on top of left pane selected. same goes others. such as, in devices tab, "software images" selected. i can't select other item left pane of tab of organizer, top 1 selected. if right click on of them, works , "organiser help" menu shown accordingly. , if tap on expand/collapse icon item in left pane, works , item expanded , collapsed accordingly. can't select expanded condition well. doesn't matter whether item collapsed or expanded, problem is, can't select item anyhow trackpad, mouse, keyboard, anything. i running xcode 4.6.3 in osx mountain lion 10.8.3 in macbook pro. i didn't problem again next day. so, rebooting mac has solved problem. working now.

iphone - How can I switch between UIViewControllers in iOS using Storyboard -

Image
i using storyboards tabbed application. within specific tab need display multiple views. have navigation bar containing 2 buttons (prev , next); when click on next app should display next view(new uiviewcontroller not next tab) , when click on prev app should switch previous view (new uiviewcontroller) without leaving selected tab (the tabbar should stay displayed , same index). i want change views inside selected tab , 1 have ideas? well if referring uiview , not uiviewcontrollers, have link view .m file normal ctrl , drag method. create ibaction when button tapped (ctrl drag button , on type tap on action). there method below automatically called when button tapped. have create second view want display , link .m file. so in method: { //view1 view want change, view2 1 want display [_view1 sethidden:true]; [_view2 sethidden:false]; } edit: uiviewcontroller it can done through interface builder. ctrl click on suivant button , drag on new uiviewcontroller. click...

Ignoring tags in yuidoc javascript documentor -

is possible ignore various tags in yuidoc make documentation build process messages more useful. i've problem tags @author, @date etc /** * xyz view ... * these tags yuidoc result in yuidoc warning * * @company <company name> * @date mon aug 27 2013 22:30:50 gmt+0200 (cest) * * these tags yuidoc able interpret * @author bernhard <email@foo> * @module welcome * @submodule frontend * @class welcomeview * @constructor * */ // yuidoc throws warnings warn: (docparser): unknown tag: company, path/to/file.js:1 warn: (docparser): unknown tag: date, path/to/file.js:1:1 and there tons of files makes impossible find "real" warnings" there way exlude tags in yuidoc? based on research have conducted, yuidoc provides no means set list of tags ignore nor other means screen out these warnings. however, can follows: (optional) fork existing yuidoc project edit yuidocjs/lib/docparser.js , , add desired tags taglist : tagl...

String or binary data would be truncated. in sql server while insert statement -

Image
i have table structure below.. but while running insert statement shows error.. insert ord_mst (orm_frcd,orm_orid,orm_mbid,orm_orqt,orm_ordt,sl_cd)values ('lym11111111','000174','lym11111111',2,'01/01/2009','123') your orm_frcd field has length of 10 , you're trying insert 11 characters.

windows 8 - Get a GPO setting using powershell -

on windows 8 machine, want read gpo setting "accounts: block microsoft accounts" can manually configured going here : computer configuration -> windows settings -> security settings -> local policies -> security options -> "accounts: block microsoft accounts" however want read setting using powershell script the 2 options tried: generate html report using get-gporeport : local policies dont come up. using gpresult /r : local group policy says following gpos not applied because filtered out. can guide me how should proceed. extremely new powershell! thanks. first, need generate gpo report using get-gporeport cmdlet , parse xml or html report parameter need.

c# - How to add gridview child controls values in dataset? -

i'm new .net development i want add gridview values in dataset in below code instead of using arraylist want use dataset code: private void getcheckboxstates() { checkbox chkcol0 = (checkbox)empmastergrid.headerrow.cells[0] .findcontrol("chkcol0"); checkbox chkcol1 = (checkbox)empmastergrid.headerrow.cells[0] .findcontrol("chkcol1"); checkbox chkcol2 = (checkbox)empmastergrid.headerrow.cells[0] .findcontrol("chkcol2"); checkbox chkcol3 = (checkbox)empmastergrid.headerrow.cells[0] .findcontrol("chkcol3"); checkbox chkcol4 = (checkbox)empmastergrid.headerrow.cells[0] .findcontrol("chkcol4"); checkbox chkcol5 = (checkbox)empmastergrid.headerrow.cells[0] .findcontrol("chkcol5"); checkbox chkcol6 = (checkbox)empmastergrid.h...

c# - Rotating An Image using AddTemplate -

using vs 2010, c#, itextsharp i creating pdf document opening various existing pdf documents, extracting images them , inserting them new pdf document. problem trying rotate images in new pdf document (depending on width , height of source images) make efficient use of space in new pdf document (ultimately used print set of stickers). looking @ output file stickers appear rotating however, right hand end of sticker dissapears out of top of document resulting in image appearing large forward slash / bottom left top of document. the original code not rotate image (and works perfectly) the x,y (sourcexstart, sourceystart) co-ordinates of image dynamically calculated the existing code - no rotation - , works perfectly if ((sourcexstart + pdfinreader.getpagesizewithrotation(1).width + 10) >= (thepagewidth - 5)) { sourcexstart = 5; sourceystart = sourceystart + lastheight + 30; lastheight = 0; } cb.addtemplate(page, sourcexstart, sourceystart); // add image sou...

android - DialogFragment not showing -

i have problems showing dialogfragment on activity. found lot of other posts issue, couldn't find solution. this activity: public class mainactivity extends fragmentactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // check whether data connection available connectivitymanager cm = (connectivitymanager) getsystemservice(context.connectivity_service); networkinfo netinfo = cm.getactivenetworkinfo(); if (netinfo == null || !netinfo.isconnectedorconnecting()) { dataconnectionunavailabledialog dialog = dataconnectionunavailabledialog .newinstance("r.string.connection_unavailable"); dialog.show(getfragmentmanager(), ""); } < other stuff > } < other stuff > } as can see want display dialog when internet connection not available. this dialog. public class d...

c# - Issue:Your app contains non-public API usage? -

i'm trying submit app on app store i'm getting errors in validation: your app contains non-public api usage. please review errors, correct them, , re-submit application. apps not permitted access udid , must not use uniqueidentifier method of uidevice. please update apps , servers associate users vendor or advertising identifiers introduced in ios 6. if think message sent in error , have used apple-published apis in accordance guidelines, send app's nine-digit apple id, along detailed information why believe above api's incorrectly flagged, appreview@apple.com. further information, visit technical support page @ http://developer.apple.com/support/technical/ . please note in above error, says "please review errors, ...". however, there no errors displayed during upload process. have search code uniqueidentifier method in code , have not found anywhere used. i'm using third party api kamcord recording video purpose. can me issue? the...

powershell - Loop X number of times -

i'm working on first powershell script , can't figure loop out. have following, repeat $activecampaigns number of times: write-host "creating $pqcampaign1 pre-qualified report" invoke-item "$pqcampaignpath1\pq report $pqcampaign1.qvw" write-host "waiting 1 minute qlikview update" sleep -seconds 60 # wait 1 minutes qlikview reload, create report , save. do{ write-host "daily qlikview reports" write-host "wating qlikview create $pqcampaign1 pq report" get-date write-host "checking...." sleep -seconds 1 write-host "" write-host "not done yet" write-host "will try again in 5 seconds." write-host "" sleep -seconds 5 } until (test-path "$pqcampaignpath1\$pqcampaign1 $pqreportname $reportdate.xlsx" -pathtype leaf) get-date write-host "done $pqcampaign1 pq report. wait 10 seconds." sleep -seconds 10 these parameters need increase 1 each loop: $pqc...

asp.net mvc - Set in the BundleConfig but load script fail - MVC4 Razor -

i have set bundleconfig file : bundles.add(new scriptbundle("~/bundles/mytest").include("~/scripts/test.js").include( "~/scripts/test.init.js")); bundles.add(new scriptbundle("~/bundles/angular").include("~/scripts/angular.min.js")); i call them layout : @scripts.render("~/bundles/angular") <!-- error --> @scripts.render("~/bundles/mytest") <!-- success --> where's error, please ? http://blog.falafel.com/blogs/noel-rice/2012/09/19/adding-your-own-scripts-and-style-sheets-to-mvc-4-bundles bundling in asp.net mvc ignore files ending .min.js. have add development version of file. bundles.add(new scriptbundle("~/bundles/angular").include("~/scripts/angular.js"));

orchardcms - how to display a list of content items from the front end? -

using orchard 1.6 have created form (accessed front end user) this form contains content part when submitted stored content item. from front end display in table format previous content items user has submitted ( user logged in) as admin can view list dashboard, user has access front end. how can display list of content items front end? i'm pretty sure have asked exact question before... , people have said use projections or write own code query content items need. so content items notes. , have attached notepart them. notepart might this: public class notepartrecord : contentpartrecord { public virtual string title { get; set; } public virtual string notecontent { get; set; } public virtual userpartrecord userpartrecord{ get; set; } } the userpartrecord record of user created it. query this: this.services.contentmanager .query<notepart>() .where<notepartrecord>(e => e.userpartrecord.id == use...

c# - Delete multiple rows in PostgreSQL with Entity Framework using WHERE IN clause -

i have postgresql database , trying remove bunch of rows table in few queries possible. looping not option. using npgsql postgres driver. i have code below not working. string[] namestodelete = promosreplies. promosrepliesloaded.groupby(pr => pr.name). select(r=>r.key).toarray(); long[] repliesidstodelete = context.promosreplies. where(pr => namestodelete.contains(pr.name)). select(r => r.idx).toarray(); if (repliesidstodelete.length > 0) { foreach (var name in namestodelete) { context.database.executesqlcommand("delete messages name = {0}", name); } string idtodelete = string.join(",", repliesidstodelete); int result = context.database.executesqlcommand( "delete message_translations idx in ({0})", ...

c# - Accessing Controller variable in View MVC -

i have started use mvc , have set simple project has controller returns value entity framework. have controller index page visual studio setup default in template. i hoping value returned index page of website. controller code misentities db = new misentities(); public actionresult index() { viewbag.message = "real time production"; var scrap = r in db.tbl_dppit select r.castgood; return view(scrap); } how access var scrap using razor? have looked @ viewbag method , other razor syntax cant seem find how access item. just because controller variable declared using var keyword doesn't mean doesn't have type. rather, tells c# type should inferred context (in case, ienumerable<t> of whatever type tbl_dppit.castgood is). so, other 3 answers partly correct, need define type of model being passed view via razor keyword @model noted other answers: // in view razor: @model ienu...

Unable to connect to any of the specified MySQL hosts in c# windows form -

i want connect windows form application mysql .it works local mysql server perfectly.but didn't work in online mysql. my code string mysqlconnection = "server=mysql.main-hosting.com;database=xxxxxxxxx;uid=yyyyyyy;password=zzzzzzzz;"; mysqlconnection connection = new mysqlconnection(mysqlconnection); connection.open(); it shows unable connect of specified mysql hosts. .how solve this? try server=mysql.main-hosting.com;database=xxxxxxxxx;user id=yyyyyyy;password=zzzzzzzz; instead of server=mysql.main-hosting.com;database=xxxxxxxxx;uid=yyyyyyy;password=zzzzzzzz; maybe connectionstring problem. or otherwise server address wrong.

c# - how to move away from guid fields as primary keys -

i in big mess , looking see if can out of it. have database primary keys on tables defined on uniqueidentifier columns. kind of forced on us, giving 'security' 1 of reasons. other guess comparatively worthier reason of tables participate in replication. i reviewing database , feel 1 avoidable future performance bottleneck may add auto-increment bigint columns in tables , make them primary keys (clustered). , somehow 'attach' pk-fk relationships properly. still retain old columns future use. any suggestions/comments/donots in regard? ours c#/mssql server r2/linq environment. edit: looking @ comments, realize left out few important details. primary key guid fields clustered , no not using newsequentialid (we use linq sql, primary keys generated client side. replication involved, weren't sure of way correctly generate sequential ids different client environments without conflicts). my 'feeling' due known fact clustered index on guid column cause h...

c++11 vs c++ - enums differences -

//c++03 enum { s1 = 0, s2, scount }; int arr[scount]; //c++11 enum class { s1 = 0, s2, scount }; int arr[(int) something::scount]; how can use enums in case without casting count of enum int? how can use enums in case without casting count of enum int?* you can't... can remove class enum class the class keyword means can't implicitly convert between enum , int removing class keyword means enum work in same way in previous versions of c++. won't need cast, loose safety of strongly typed enums allowing implicit casts integral values. //c++11 enum class { s1 = 0, s2, scount }; int arr[scount]; // errror //c++11 enum { s1 = 0, s2, scount }; int arr[scount]; // ok you can read more strongly typed enums here other option cast it, doing. should avoid old c-style cast , use static_cast<> instead has better type safety , more explicit. //c++11 enum class { s1 = 0, s2, scount ...

less - media query and not -

i have following less code: @mobile: ~'screen , (max-width: 480px)'; then use follows: @media @mobile { // code } it works fine use "not" like: @media not @mobile { // code } but error parseerror: unrecognised input in "not" part. is possible solve this? maybe this: define width of mobile device: @mobilewidth: 480px; then larger non-mobile device: @notmobilewidth: @mobilewidth + 1px; create less variables both mobile , notmobile: @mobile: ~'screen , (max-width: @{mobilewidth})'; @notmobile: ~'screen , (min-width: @{notmobilewidth})'; and use in media queries: @media @mobile { // mobile code } @media @notmobile { // not-mobile code }

linux how can i be sure what conf file service is using? -

hello im using ubuntu , example installed nginx via apt-get , via passenger , have 2 nginx.conf location (/opt/nginx/conf/nginx.conf , /etc/nginx/nginx.conf) (but removed first nginx installation apt-get remove nginx ) can ensure configuration file (nginx.conf) /etc/init.d/nginx start use ? si more general linux question nginx related. one approach rename 1 of these configuration files , see whether service can still start.

How to delete a file on a method exit in java? -

i trying figure out how make sure temporary file gets created in method gets deleted time method returns. have tried file.deleteonexit(); , when program stops, not method. have tried try , finally block. using finally block way achieve this? public string example(file file) { // random processing file here file.canwrite(); inputstream() = new fileinputstread(file); // when ready return, use try block try { return file.getname(); } { is.close(); file.delete(); } } i think looks ugly. have suggestion? as mentioned @backslash in specific case can remove file before return: file.delete(); return "file processed!"; however in common case if code inside try block can throw exception approach looks fine. can use aspect oriented programming (e.g. using aspectj) looks overkill in case. you can improve code using nice new feature of java 7. each instance of closable closed in end of try block, e.g.: t...

image - Can't change background color of java application -

i'm trying hand @ making picture viewer in java , life of me, can't background color of viewer change black. here's latest code: public class pictureviewer extends jframe { static class pauseaction extends abstractaction { public void actionperformed(actionevent arg0) { pauseviewer = !pauseviewer; } } static class quitaction extends abstractaction { public void actionperformed(actionevent e) { stopviewer = true; pauseviewer = true; viewer.setnexttoview(); system.exit(0); } } static double height; static final string newline = system.getproperty("line.separator"); static boolean pauseviewer = false; static dimension screensize = new dimension(); static boolean stopviewer = false; static pictureviewer viewer; static double width; jlabel area = new jlabel("", jlabel.center); int currentpic = 0; file di...

c# - Filename 'file' is too long or invalid Visual Studio 2010 and 2012 -

i've found interesting error when tried build .net 3.5 class library, , i've got error in visual studio 2012. error 201 file name '..\..\..\..\b2b.common\documentation\ foobarbaz.core.providers.scheduledtaskproviders .foobarbazsearchalerting.xml' long or invalid d:\foobarbaz\5000\5000 - xyz - xyxy - example - ire\b2b.common\src\foobarbaz.core.providers .scheduledtaskproviders\foobarbaz search alerting\csc foobarbaz search alerting the problem is, can build in vs2010 without problem. according msdn error shows, when filename path longer 260 character. it's 156. so 2 questions are: why work in vs2010 , not 2012? how can solve in vs2012? this known issue. file names can't infinitely long. need redesign naming conventions. frankly, name, foobarbaz.portfolio.core.providers.scheduledtaskproviders .foobarbazsearchalerting.xml sadomasochism of computing. to avoid this, map source control branches simple c:\dev\branch_name. you n...

How to stop Android action bar logo and title being transparent -

Image
i'm using compat library add action bar app. have set custom theme extends theme.appcompat , set background action bar , background application. action bar icon , title backgrounds seems transparent means app background visible through action bar can see below. ideas? thanks

powershell - How to explode a Dictionary List as headers in a format-table -

updated include listing blank/empty properties objects sorry title, not sure how label question. want express list of dictionary objects key header/property , value header's/property's value. for example take following posh code $obj1 = new-object object | select data; $obj1.data = @{"header1"="value1";"header2"="value2";} $obj2 = new-object object | select data; $obj2.data = @{"header1"="valuea";"header2"="valueb";} $obj3 = new-object object | select data; $obj3.data = @{"header1"="value1";"header3"="valuec";} $tmp = @($obj1,$obj2,$obj3) $tmp looks following: data ---- {header2, header1} {header2, header1} {header3, header1} $tmp | select -expand data gets following useful information name value ---- ----- header2 ...