Posts

Showing posts from April, 2012

c++ - How can you specify carriage return and newline character match when using boost::regex? -

i having problem boost::regex behaviour when comes matching \r , \n characters in string. communicating on serial port modem linux c++ application , receiving following message it ati3\r\nv3.244\r\nok\r\n i know string correct check ascii hex values of each character returned. problem application needs strip out version number specified vx.xyz part of string. end using following boost::regex based code: string str_modem_fw_version_number = ""; string str_regex("ati3\r\nv(\d+[.]\d+)\r\nok\r\n"); boost::regex patt; try { patt.assign(str_regex); boost::cmatch what; if (boost::regex_match(str_reply.c_str(), sc_what, patt)) { str_modem_fw_version_number = string(sc_what[1].first,sc_what[1].second); } } catch (const boost::regex_error& e) { cout << e.what() << endl; } the above not work - can see string correct sure making obvious error cr , nl characters in regex. have tried following not

c# - How can i check if the file size is larger then it was in the beginning? -

this code: private void timer2_tick(object sender, eventargs e) { timercount += 1; timercount.text = timespan.fromseconds(timercount).tostring(); timercount.visible = true; if (file.exists(path.combine(contentdirectory, "msinfo.nfo"))) { string filename = path.combine(contentdirectory, "msinfo.nfo"); fileinfo f = new fileinfo(filename); long s1 = f.length; if (f.length > s1) { timer2.enabled = false; timer1.enabled = true; } } } once file exist 1.5mb size after minutes file updating 23mb. want check if file larger before stop timer2 , start timer1. but line: if (f.length > s1) not logical since im doing time long s1 = f.length; how can check if file larger ? you can rely on global variable (like 1 using contentdirectory

Passing a list of arguments to plot in R -

i use same arguments several calls plot . tried use list (which can serve dictionary) : a <- list(type="o",ylab="") plot(x,y, a) but not work : error in plot.xy(xy, type, ...) : invalid plot type any suggestion ? extending @baptiste's answer, can use do.call this: x <- 1:10 # data y <- 10:1 do.call("plot", list(x,y, type="o", ylab="")) or setting arguments in list , call a a <- list(x,y, type="o", ylab="") do.call(plot, a)

c# 4.0 - how to generate dynamic parametrized unit test cases for c# application in vs 2012 -

i explored pex , code digger generation of unit test cases exploring code found limitations in them .code digger requires portable class libraries whereas pex requires vs 2010 . need know there tool generate unit test cases automatically c# applications pex or better that can used vs 2012 . regards priya

c# - Check that VPN ports are open -

is there way check udp ports 500 , 4500 of vpn server responding ? goal check if firewall or blocking these ports. thanks in advance so, udp doesn't acks or connections tcp does; way sure port responding send data , response (there no requirement respond though). since these specific ports, assume there specific application/protocol looking at. need open port , either send garbage data or form of identification payload (depending on protocol). this previous question outlines need handle that.

emulation - ANDROID: How to show the system navigation bar in an emulator -

how can enable system navigationbar(the 1 including home/back/menu) on jellybean emulator? googling this, said can done changing property qemu.hw.mainkeys, can't find set constant. can me? i know old question. but, trick following: navigate .android/avd/virtual-device.avd , , change following values in following files: config.ini : hw.mainkeys=no, hw.keyboard=no hardware-quemu.ini : hw.mainkeys = no, hw.keyboard = no that should disable navigation bar on virtual device. note: enable use of keyboard, have set these parameters yes.

node.js - Catching HTTP response event -

i building node web application (using express) , keep dry possible, automatically acquire database connection each request need release (back pool). i manually in every route polluting code. figured should listen server events , release once response either finished generating or sending. options have? events (and inside object (app, request or whatever) triggered when response complete? res inherited eventemitter, , can use default events can emit own ones. 1 of common finish (in node.0.8.12 , older end ) event: res.on('finish', function() { // request processing finished }); you can attach event requests if want, or specific in roots. additionally can create middleware, db connection, , attach finish event , possibly timeouts. , need add middleware routes, minimum of repetitive coding. in mean time, recommend not create db connection each request, big overhead , unnecessary use of sockets io handlers. can freely use onse single connection, , effic

gzipstream - Resteasy generally enable GZIP -

i have resteasy + java ee application. when add @gzip component class, server-answer gzipped, if client sends "accepts:gzip" is there way enable gzip components? don't add annotation every class. i'm using resteasy jax-rs 3.0.1 no, there no way annotations enable gzip resources. if wanted forego adding annotation every class create servlet filter looks @ incoming headers , gzips response on way out.

Magento Checkout Stop refresh -

i redesign order reciept (last step in checkout page after payment). we use standard 1 page checkout. in order see changes made @ reciept, not want checkout go frontpage when hit refresh. is there way can make magento stay @ reciept page instead of automaticly redirects frontpage? i have tryed commented out successaction in onepagecontroller.php did not help. ideas? //simon as far it's temporary testing, can comment out line $session->clear(); in successaction() method mage_checkout_onepagecontroller .

android - AndroidDriver - Selenium library issues and unable to read AndroidManifest.xml error -

i trying run example test found here https://code.google.com/p/selenium/wiki/androiddriver#run_the_tests on android emulator (mac), i'm running problems when trying run test. i have set emulator , installed webdriver apk, in eclipse created new android application project , created class onetest.java , copied in code (also imported org.openqa.selenium.webdriver; missing example code). imported 2 selenium-java-2.33.0 jars library. updated androidmanifest be: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.test" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:l

css - Oversize div moved when highlighted -

Image
i have div sized placing left:260px make stay right of menu bar, seen in before. once user try highlight something, went right 260px extra. sized responsiveness use 100% can't right percentage prevent happened. idea how can fix that? preferably css directly, not calc or jquery. thanks

php - How to check if $array = array(1) { [""]=> NULL } is true or false -

i have addon case array gets on var_dump($array) : array(1) { [""]=> null } how can check if true or false? if array set e.g. array(1) { ["test"]=> string(2) "test" } i tried if ($array == null) if ($array[""] == null) if ($array[""] == "null") if ($array == "null") "" array-index little bit scary ... since $array[0] first element won't work, try figure out if array nodes null: $fillcount = 0; foreach ($arrdata $key => $value) { if (!is_null($value)) $fillcount++; } if ($fillcount <= 0) { // nothing useful in array } else { // useful content in array }

jquery - definition function button javascript -

this code in javascript; have 1 piechart gets data datasource. want add 1 button in page when click can see piechart. i want define function draw in button. html: <input id="drawchart" type="button" value="click me" "> <script type="text/javascript" src="google.com/jsapi"></script>; <script src="{{=url('static','js/xxx/code/xxxx.js')}}"></script> <div id="reportingcontainer"></div> !function($) { function gettable() { $.ajax({ datatype: 'json', type: 'get', url: 'call/json/mytables', xhrfields: { withcredentials: true }, success: function(response) { sendquery(response[0]); }, }); } $("#drawchart").click( function () {

Laravel 4 Using HybridAuth: Not Getting Autoloaded in class map -

after downloading hybridauth composer , need manually add hybridauth's directory in /vendor/composer/autoload_classmap.php , should automatic. below composer.json, can point me problem why hybridauth not getting written in autoload automatically? { "name": "laravel/laravel", "description": "the laravel framework.", "keywords": ["framework", "laravel"], "require": { "laravel/framework": "4.0.*", "way/generators": "dev-master", "hybridauth/hybridauth": "*", "intervention/image": "dev-master" }, "autoload": { "classmap": [ "app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds",

asp.net - Initial selection for a DropDownList overriding user selection -

i'm trying set initial selection dropdownlist calling: drop.selectedindex = 5 in page_load. works, if change selection manually , want save form, i'm still getting initial selection instead of new selection when calling drop.selectedvalue. what's wrong? you have forgotten check if(!ispostback) . otherwise select 6th item again on postbacks before selectedindexchanged event triggered (or button-click event): protected void page_load(object sender, eventargs e) { if(!ispostback) // on initial load , not on postbacks dropdwonlist1.selectedindex = 5; }

javascript - Query regarding adding PubNub Channel dynamically -

i using pubnub publish , subscribe messages. there technical requirement in have add pubnub channel name dynamically. problem is, cannot load page again. work doing through jquery , interacting server using ajax. is possible so. if yes, how. best, abhinav sharma yes possible. first initialize pubnub using pubnub.init() method if don't use div setup credentials. can make ajax request server obtain channel name. after obtaining channel name, subscribe via pubnub subscribe() call. can subscribe pubnub channel @ time. assuming server respond request text datatype: var pubnub = pubnub.init({'publish_key':'demo','subscribe_key':'demo'}); pubnub.ready(); $.ajax({ url :'http://example.com/getchannel', type :'get', datatype :'text', success : function(data) { pubnub.subscribe({ channel : data, message : function(m) { console.log('new message received: ',m);

javascript - How to force the browser to stop parsing dynamically inserted code to HTML 4? -

i need parse old html pdf file, have jar this, accepts legit xhtml code. have parse old html code jar accept it. know how html-code parse idea use html-parser john resig parse tags (img, br, meta) straight xml, have needed effect (mostly closing tags) on them. my actual attempt looks this: function fixtags() { var tagstoparse = new array( "br", "img", "input", "meta" ); for(i = 0; < tagstoparse.length; i++) { var elements = document.getelementsbytagname(tagstoparse[i]); for(j = 0; j < elements.length; j++) { elements[j].outerhtml = htmltoxml(elements[j].outerhtml); } } } the problem here browser interpret new code element html4, leads him changing stuff wanted change. example <br> becomes <br/> after going through parser, browser interpret html4 , outerhtml property of element <br> again. my first attempt solve force document xhtml temporarily: var root

sql server - What are the possible reasons for SQL Dumps? Tried using DBCC CHECKDB but with no success -

i have sql server 2008 (rtm) instance installed on windows server 2003. has around 30 databases. configuration running fine year, until today when sql server stopped unexpectedly , windows showed infamous bsod(blue screen of death). i checked logs (application, system, sql error logs etc) , found sql had been generating dumps past 2 months. (sqldump0001,sqldump0002,sqldump0003,... upto sqldump0060 (60 sqldumps)). i tried using dbcc checkdb , found "inconsistency errors" in 2-3 databases. when again used dbcc checkdb on same databases, on different server, there no errors. can come possible reasons this? hardware issue? possibly ram? since happened today on production server, shifted backup server temporarily. need fix asap. even minutest of appreciated! solved!! took me day although. i using ibm x3200 machine supports ddr2 pc2-5300(e) rams e stands ecc. unfortunately, during hardware upgrade 2 months back, team upgraded x3200 machine ddr2 pc2-5300(u)

ruby on rails - My Rspec won't work -

this error getting while trying bundle exec rspec spec/requests/static_pages_spec.rb: no drb server running. running in local process instead ... /users/hetzerbr/sample_app/spec/requests/static_pages_spec.rb:1:in `require': /users/hetzerbr/sample_app/spec/spec_helper.rb:29: syntax error, unexpected tassoc, expecting kend (syntaxerror) config.fixture_path => "#{::rails.root}/spec/fixtures" ^ /users/hetzerbr/sample_app/spec/requests/static_pages_spec.rb:1 /users/hetzerbr/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load' /users/hetzerbr/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files' /users/hetzerbr/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map' /users/hetzerbr/.rvm/gems/ruby-1.8.7-p374/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec

android - infinite sync loop syncadapter -

i have same problem stated here: android syncadapter stuck in infinite sync loop but after trying implement notifychange (uri uri, contentobserver observer, boolean synctonetwork) in onperformsync, realized didn't know how contentobserver needed (which defined , passed in in main activity) any tips? edit 1: like person first time sync loops indefinitely i found contentresolver.cancelsync(account, authority); work well, if has better solution...please let me know! edit 2: i followed advice post android syncadapter automatically initialize syncing after stepping through debugger, confirmed synctonetwork false when passed notifychange, yet infinite sync continues without cancelsync...still no permanent solution i asked question time ago when dipping toes android programming, , figured i'd share found who's curious. when following tutorials implement custom contentprovider, saw notifychange (uri uri, contentobserver observer) used after update() ,

jquery - CSS input checkbox when input is already defined -

i'm having difficulty aligning checkboxes in form. i've created jsfiddle here css defines input earlier on, defined specific checkbox input near bottom of css code. reason, it's not working. main css: /*inputs*/ #msform input, #msform textarea { padding: 15px; border: 1px solid #ccc; border-radius: 3px; margin-bottom: 10px; width: 100%; box-sizing: border-box; font-family: montserrat; color: #2c3e50; font-size: 13px; } added checkbox label , input (not working properly) label { float: left; display: block; padding-left: 15px; } input[type=checkbox] { width: 13px; height: 13px; padding: 0; margin:0; vertical-align: middle; position: relative; top: 26px; right: 60px; *overflow: hidden; } you need apply style id #msform overwrite previous declaration. #msform input[type=checkbox] { width: 13px; height: 13px; padding: 0; margin:0; vertical-align: midd

Which coordinate space is the canonical default for each shader pipeline stage? -

i'm working direct3d 11 , hlsl. use 4 different shaders (vertex, hull, domain , pixel). i have troubles using right coordinate space in shaders. identify appropriate space vertex, hull, domain , pixel shader stages? typically, vertices streamed vertex shader in patch space, sort of local coordinate system describes areas tesselated (patches), may not describe model (polygons). hull , domain shaders work on these patches. hull shader runs in patch space, while domain shader runs half in patch space, passed hull shader control point function (a control point "patch level vertex"), , half in tangent space of patch (i.e. in plane of patch). allows know positions of new vertices in relation control points of patch. once tesselation complete, model can in either projection space, if have no geometry shader, or in model space if do. geometry shader can add or subtract vertices model, transform results projection space, , pass them pixel shader. final stage, pixel

Sql Server 2008 Performance issue combinning CONTAINSTABLE and OR -

table_x contains 7000 rows table_y contains 1 000 000 rows this request running fast on sql server2005 take 3 minutes on sql server 2008 select [extent1].[id] [id] [dbo].[tablex] [extent1] inner join [dbo].[tabley] [extent2] on [extent1].[id] = [extent2].[fk_id] ( ( [extent2].[fk_id] in ( ( select [key] containstable([tablex], (description), n'"pmi_log"') [ct] ) ) ) or ( [extent2].[id] in ( ( select [key] containstable([tabley], (description), n'"pmi_log"') [ct] ) ) ) ) already rebuild index, statistics , catalog. the 2 subqueries (select..from containstable...) take 15ms the execution plan takes 100% of time in table valued function [fulltextmatch] after lots of test, happens when put or between fulltext queries, performance falling down. can ?

VB6 SQL Field Data to ListView box? -

i need add sql data field listview box. have @ moment. unsure on how add data listview box list. option explicit private sub commandbutton1_click() dim connectionobj adodb.connection set connectionobj = new adodb.connection dim rs new adodb.recordset dim cmd adodb.command dim sqlstr string connectionobj.cursorlocation = aduseclient connectionobj.open "provider=msdasql;dsn=svr-testsql-01_sql2008r2;database=webvanilla;uid=webuser;pwd=1209sawedxz1209;" sqlstr = "select top 10 * defactouser.f_gl_events" rs.open sqlstr, connectionobj, adopenkeyset msgbox "connected" & rs.recordcount if rs.recordcount > 0 rs.movefirst while not rs.eof 'add list view box command data = rs.fields(0) rs.movenext loop end if

c++ - Protocol Buffer Make command not found libprotobuf.dll.a -

i downloaded protocolbuffer-2.5.0.zip file, follow readme.txt installion: ./configure make make check make install and in command make error message: "g++.exe: error: /cygdrive/d/bayproject/protobuf-2.5.0/src/.libs/libprotobuf.dll. a: no such file or directory" but file libprotobuf.dll.a there! what wrong? thx do have gcc/mingw installed cygwin64? had same issue realized configuring perl64 gcc compiler. installing cygwin version setup.exe allowed protobuf build , pass tests.

how to create manual content assist for eclipse -

i want create manual content assist eclipse plugin development without using these public icontentassistant getcontentassistant(isourceviewer sourceviewer) { contentassistant assistant= new contentassistant(); assistant.setcontentassistprocessor(new javacompletionprocessor(), idocument.default_content_type); assistant.setcontentassistprocessor(new javadoccompletionprocessor(), javapartitionscanner.java_doc); ... return assistant; } i open plugin project hello world command what can next?

python - Write local files using skulpt -

is there tutorial out there on using "skulpt" , local sqlite (client side). using skulpt, want able create, write, open, modify local files. few years ago, wrote small browser-based app personal use using sqlite , javascript. problem faced javascript not allow access local files, write files, etc...i hope able go around limitation using skulpt. thank you. skulpt uses 100% javascript under hood, have exactly same limitations in skulpt in regular javascript.

algorithm - Making a fully connected graph using a distance metric -

say have series of several thousand nodes. each pair of nodes have distance metric. distance metric physical distance ( x,y coordinates every node ) or other things make nodes similar. each node can connect n other nodes, n small - 6. how can construct graph connected ( e.g. can travel between 2 nodes following graph edges ) while minimizing total distance between graph nodes. that don't want graph total distance traversal minimized, node total distance of links node minimized. i don't need absolute minimum - think np complete - relatively efficient method of getting graph close true absolute minimum. i'd suggest greedy heuristic select edges until vertices have 6 neighbors. example, start minimum spanning tree. then, random pairs of vertices, find shortest path between them uses @ 1 of unselected edges (using dijkstra's algorithm on 2 copies of graph selected edges, connected unselected edges). select edge yielded in total largest decrease of dista

css - Splitting LESS output into two files - variable and constant -

i'm using great number of variables in less implementation, there many rules hard coded. variables defined on compile less file containing style definitions. is possible split of css rules output less variable parts , constant parts, without manually creating 2 separate files? so: @mycolour: white; .foo { background-colour: @mycolour; width: 120px; } becomes 2 files: .foo { background-colour: white; } and .foo { width: 120px; } this way if theme changes, variables need reloaded. any ideas? thanks short answer: no "without manually creating 2 separate files?" (emphasis added), answer "no." you, programmer, have code 2 separate files , 1 contains variable calls, 1 contains "hard coded" info (although, see update below). not recommend that, hard maintain (as far seeing going on 2 different .foo entries in 2 different files). that's why hoping split them after coded (automatically), not possible inst

java - GSON - JsonSyntaxException - Expected name at line 7 column 4 -

i have following result class object returned json. public class result { public string objectid; public string dtype; public string type; public string name; public string description; public result() { this.objectid = ""; this.dtype= ""; this.type=""; this.name= ""; this.description = ""; } public string getobjectid() { return objectid; } public void setobjectid(string s) { this.objectid = s; } public string getdtype() { return dtype; } public void setdtype(string s) { this.dtype= s; } public string gettype() { return type; } public void settype(string s) { this.type = s; } public string getname() { return name; } public void setname(string s) { this.name = s; } public string getdescription() { return description;

sitecore6 - Sitecore web Forms for Marketers module install error -

i getting following error message while installing sitecore web forms marketers module intranet: sitecore.exceptions.invaliditemnameexception: item name must satisfy pattern: ^(?=.{1,100}$)[\w\*\$][\w\s\$\-]*(\(\d{1,}\)){0,1}$ (controlled setting itemnamevalidation) @ sitecore.data.items.itemutil.assertitemname(string name) @ sitecore.data.items.item.set_name(string value) @ sitecore.install.items.iteminstaller.versioninstaller.installversion(item version) @ sitecore.install.items.iteminstaller.versioninstaller.pasteversion(xmlnode versionxml, item target, versioninstallmode mode, iprocessingcontext context) @ sitecore.install.items.iteminstaller.installentry(packageentry entry) @ sitecore.install.items.iteminstaller.flush() @ sitecore.install.items.legacyitemunpacker.flush() @ sitecore.install.framework.sinkdispatcher.flush() @ sitecore.install.utils.entrysorter.flush() @ sitecore.install.framework.entrybuilder.flush() @ sitecore.install.zip.pack

How to grep with a list of words -

i have file 100 words in separated new lines. search file b see if of words in file occur in it. i tried following not work me: grep -f b you need use option -f : $ grep -f b the option -f fixed string search -f specifying file of patterns. may want both if file contains fixed strings , not regexps. $ grep -ff b you may want -w option matching whole words only: $ grep -wff b read man grep description of possible arguments , do.

networking - How to correlate devices in Apple Airport Utility and iStumbler? -

i've got 3 airports (one extreme, 2 different vintages of express) joined in extended wireless network. can see devices in istumbler, how tell which? airport utility tells me basestation names, ip addresses, , serial numbers. istumbler tells me mac address, have no way tell device i'm seeing in airport utility matches 1 i'm seeing in istumbler! is there way can airport utility show me mac address? software versions: airport utility 6.3.1 istumbler 2 (100) it turns out, there's better way. option-double-click on device icon, , alternate interface more information (including mac address). control instead of option apparently gives different screens.

xml - This webpage contains content that will not be delivered using a secure HTTPS connection, although the server only provides a HTTPS connection -

Image
calling resource rest service causes webbrowser display message: the server on rest service deployed (localhost) provides secured https connection. realy have no idea root cause of waring is. xml file received web browser. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <category xmlns="https://localhost/" id="1"> <description>des_swdevelopment</description> <name>swdevelopment</name> </category> the xsd file on server side looks like: <?xml version="1.0" encoding="iso-8859-1"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns="https://localhost/" targetnamespace="https://localhost/" elementformdefault="qualified" xmlns:pref="https://localhost/" > <xs:element name="category"> <xs:complextype > <xs:sequence>

c# - Adding Event to a Method -

i have http class i've created, , to, if possible, attach method each time either http.post() or http.get() called. i'd able attach event either before, or after. i see being done in lot of frameworks web, such wordpress , symfony, i'd similar on winforms app. what design pattern looking achieve can go , google it. you can create events on objects , invoke them anywhere in code. quite often. public event eventhandler getting; public event eventhandler setting; void get() { if (getting != null) getting.invoke(this, eventargs.empty); } void post() { if (setting != null) setting.invoke(this, eventargs.empty); } then other classes can handle these events this: myhttp.getting += myhttp_getting; public void myhttp_getting(object sender, eventargs e) { } edits: you invoke event this: void post() { if (setting != null) setting(this, eventargs.empty); } you can invoke event within own class. not problem becaus

oracle - How to output all rows in a pl/sql dynamic select without dbms_output.put_line -

i have 3 sql blocks below. first , second blocks work fine. third returns 1 row. in real world example, have 13 refcursors , each query has several columns in it. want avoid writing hundreds of dbms_out.put_line(cur.column_name) statements --#1 correctly returns 8 rows. var rc refcursor begin open :rc select object_id,object_name user_objects rownum < 9; end; print rc -------------------------------------------------------------- --#2 correctly returns 8 rows set serveroutput on begin cur in (select object_id,object_name user_objects rownum < 9) loop dbms_output.put_line(cur.object_id); dbms_output.put_line(cur.object_name); end loop; end; --------------------------------------------------------------- --#3 fail, returns 1 row set serveroutput on var rc refcursor begin cur in (select object_id,object_name user_objects rownum < 9) loop open :rc select object_id,object_name user_objects object_id = cur.object_id; end loop; end; print rc it's not

css3 - CSS div-table and text-overflow:ellipsis -

i have div display of table. want table take 100% of page. within table 1 row several cells (display style of table-cell). goal css solution allows table-cells show ellipsis if text long. have put simple example jsfiddle shows issue. can lead me in right direction cells show ellipsis? jsfiddle <div class="table-wrap-wrapper"> <div class="table"> <div class="table-row"> <div class="table-cell data"> <span>this_is_a_really_long_username_that_is_too_long</span> </div> <div class="table-cell"> </div> <div class="table-cell data"> <span>this_is_a_really_long_emailaddress_that_is_too_long</span> </div> <div class="table-cell"> </div> <div class="table-cell data">

BizTalk Business Rule for checking against list of values contained in .csv, xml, etc -

i'm new bre , new biztalk whole, may quite simple , evading me... what i'd this: create business rule in bre takes input incoming message , checks see if value contained in message matches of values within specified set of values. sample message follows. <isfound> field updated accordingly. <n1:documenttemplate xmlns:n1="mynamespace"> <rootoid>2.16.840.1.113883.3.51.60.2.5</rootoid> <isfound>false</isfound> </n1:documenttemplate> basically i'd match <rootoid> node against list of values. i've created business match <rootoid> against hardcoded value in conditions of business rule...just proof of concept learn basics of how use bre , call rule in orchestration. i'm failing find way match against list of values beyond doing giant list of hard-coded ors in "conditions" of business rule. list of accepted values large enough doing bunch of ors not going work. ideally, i'

edit - svnrdump hits a svn precommit hook - how can I resolve -

my company merging number of svn repositories. with svn 1.7 we're using "svnrdump dump --incremental --revision start:stop source_url > patch.dump" download contents of old repository. and "svnrdump load new_url < patch.dump" upload new repository. but i've hit snag. our have setup number of pre-commit hooks. 1 mandates @ least 10 characters in comment. i've found commit no comment & no author (not sure how possible). hence error svnrdump: e165001: commit blocked pre-commit hook (exit code 1) output: internal failure while executing hook in repository, */svn/code/path*. require administrator correct. please file case using srm. error: 'svnlook info' call failed: get_info() failed: insufficient/invalid output: *myid* 2013-07-25 08:02:59 -0700 (thu, 25 jul 2013) 0 how can resolve this? possible edit patch.dump? i.e. assign author & comment? have involve department? i load surrounding revisions & manually c

Good Dynamics: How can a third party create an IPA consumable by the Good Wrapping server? -

we independent third party software developer. our software approved apple, , available download appstore. have potential customer has dynamics setup ( http://www.good.com ) (with wrapper, control, proxy servers etc.), , we're trying figure out how our ipa can made consumable wrapper server. reading dynamics' guide application wrapping, it's little confusing. states "need ready-to-wrap ios app (.ipa) build enterprise or ad hoc distribution. ready-to-wrap means working ios app valid signing certificate.". there 2 possible interpretations of description: 1) (the independent third party software developer) create certificate potential customer, create ad hoc provisioning profile certificate, create ipa, , give them certificate , ipa. can feed these wrapper server, wrap application. 2) (the potential customer dynamics setup) need have enterprise distribution account (to enable them distribute applications within enterprise employees). need have certificate , p

Collections to list in tcl -

hi know how convert collection list in tcl. output getting in form of collections want change list. generally use collections when dumping/querying data tools use tcl (for example design compiler synopsys). these collections list not accessible normal list commands. access them need use "foreach_in_collection" command , need use get_object_name (or equivalent command) , need build list (lappend) of output of get_object_name. list can use tcl list operations. foreach_in_collection , get_object_name tool specific commands , can not found in tcl , work run through tool interface. hope helps.

list - Iterate through lines changing only one character python -

i have file looks this n1 1.023 2.11 3.789 cl1 3.124 2.4534 1.678 cl2 # # # cl3 # # # cl4 cl5 n2 cl6 cl7 cl8 cl9 cl10 n3 cl11 cl12 cl13 cl14 cl15 the 3 numbers continue down throughout. what pretty permutation. these 3 data sets, set 1 n1-cl5, 2 n2-cl10, , set 3 n3 - end. i want every combination of n's , cl's. example first output cl1 n1 cl2 then else same. next set cl1, cl2, n1, cl3...and on. i have code won't want, becuase know there 3 individual data sets. should have 3 data sets in 3 different files , combine, using code like: list1 = ['cl1','cl2','cl3','cl4', 'cl5'] line in file1: line.replace('n1', list1(0)) list1.pop(0) print >> file.txt, line, or there better way?? in advance this should trick: from itertools import permutations def print_permutations(in_file): separators = ['n1', 'n2', 'n3'] cur_separator = none

timers [Delay without Freezing the app !] C# -

i'm trying make application every 10 minutes executes 10 different sql queries, , between each sql query there should short delay (for example, 1 second). if try use thread.sleep(1000); , other timers stop , whole application freezes. any idea how without freezing application or stopping other timers? you can use threading spin thread performs actions. the simplest form system.threading.threadpool.queueuserworkitem(waitcallback) it takes delegate consumes single object , performs task. e.g. private void worker(object ignored) { //run first query thread.sleep(1000); //run second query etc. } //the following code want start process //for instance in response timer threadpool.queueuserworkitem(worker);

html - Losing opacity transition after image click -

i'm using css opacity transition mouse hover whenever click on image click outside image (to bring images jquery) css transition doesn't work anymore. my css transition .grid li a:hover img { -webkit-transition: opacity .2s ease-in; -moz-transition: opactiy .2s ease-in; -ms-transition: opacity .2s ease-in; -o-transition: opacity .2s ease-in; transition: opacity .2s ease-in; opacity: 1; } .grid:hover li { -webkit-transition: opacity .2s ease-in; -moz-transition: opactiy .2s ease-in; -ms-transition: opacity .2s ease-in; -o-transition: opacity .2s ease-in; transition: opacity .2s ease-in; zoom: 1; filter: alpha(opacity=100); opacity: 0.3; } instead of posting whack load of code thought jsfiddle better. jsfiddle it's because inline styles overriding css styles. can remove style attribute once you're done animation , make sure doesn't override css styles. http://jsfiddle.net/azizpunj

Replace visual studio 2012 Diff tool with winmerge when using Microsoft Git Provider -

Image
i have visual studio 2012 v3 , git extensions installed. i want change default merge tool winmerge seems not trivial task when microsoft git provider chosen. when go vs -> tools -> options -> source control have plug-in-selection tab , cannot choose configure tools change winmerge. is there way of using git extensions winmerge inside vs2012? backed dzone-article , trick configure diff-tool in git.config: open git bash in repository create config section winmerge diff-tool: $ git config --local difftool.winmerge.cmd '"c:\program files (x86)\winmerge\winmergeu.exe" "$local" "$remote"' configure git switch winmerge diff-tool: $ git config --local diff.tool winmerge if want have setting global setting, replace --local switch --global .

ruby - Redirect-related double render error in rails -

in controller redirecting user if signed out. pulling list of professionals.. , need redirect there too, if none exist. there way solve dilemma? def purchase @style = style.find(params[:id]) if user_signed_in? && current_user.consumer @professionals = professional.where(...) if @professionals.empty? redirect_to style_path(@style) else ... end ... else flash[:error] = "please sign in consumer access page" redirect_to style_path(@style) end end try adding and return action returns , not continue. please try following: redirect_to style_path(@style) , return

r - Splitting lme residual plot into separate boxplots -

using basic plot function (plot.intervals.lmlist) lme model (called meef1), produced massive graph of boxplots. vector v2andv3commoditycombined has 98 levels. plot(meef1, v2andv3commoditycombined~resid(.)) i separate grouping values of variable v2andv3commoditycombined either graph them separately, order them, or exclude some. i'm not sure if there code or if have extract information lme output. if case, i'm not sure extract create boxplots extracting residuals returns 1 value each level. if impossible, advice on how space out commodity names equally helpful. thank you. for each level of v2andv3commoditycombined , y axis , x axis be? since you're splitting plots v2andv3commoditycombined , can't use 1 of axes. let's pretend want traditional residuals on y axis , fitted values on x axis, in separate plot each of 98 levels. can change code plot whatever want plot. as per ?plot.lme , this: plot(meef1,resid(.,type='pearson',level=1)~f

iphone - Game Center Leaderboard (Sandbox) displays wrong score -

i'm developing simple game whitch allow user achievements , score it. , user can post score game center leaderboards. (achievements created game center). when submit score leaderboards, displays in game center leaderboards "my" correctly. , achievements displayed correctly. faced problem: when switch different test game center account (which created inside game center), see no scores in leaderboard. my point - if can record score leaderboard frome 1 account, why cant see scores anothers? this how game center works. scores posted game center appear on leader-board delay. happens on both sandbox , production servers. don't worry it, wait hour or 2 , check again. remember, when retrieve leader-board score player loadscoreswithcompletionhandler: method might outdated results.

Unmarshalling nested objects from JSON with JAXB -

i'm trying unmarshall input json jaxb objects eclipselink. however, when try this, find nested objects end being set null. can try , unmarshall nested object itself, , work until point has unmarshall further nested object, set null. for example, take class: @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "event", proporder = { "objectbs" }) public class objecta implements serializable { private final static long serialversionuid = 56347348765454329l; @xmlelement(required = true) protected objecta.objectbs objectbs; public objecta.objectbs getobjectbs() { return objectbs; } public void setobjectbs(objecta.objectbs value) { this.objectbs = value; } public boolean issetobjectbs() { return (this.objectbs!= null); } @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { "objectb" }) public static class objectbs implemen

HTML in Express and node.js? -

i don't know if noob question, have seen lot of documentation use express in node.js , express. see use lenguage called "jade" rendering html file. why? i'd know if necesary use jade or can render templates in express html. no, it's not necessary use jade express. it's popular option since jade default generated applications , maintained same developer express . they tend stay up-to-date each other, such addition of template inheritance in jade express dropped support layouts . but, there number of other view engines offer built-in support express. and, consolidate project can mediator/ glue have even more options : atpl dust eco ect ejs haml haml-coffee handlebars hogan jade jazz jqtpl just liquor mustache qejs swig templayed toffee underscore walrus whiskers note: believe misunderstood question , answered broadly @ first. but, leaving rest of wrote below

java - Export GAE App Engine Datastore entities to csv -

i have list of entities , properties displayed in html table add capability users click button download entity data .csv file. best way go doing this? have looked @ creating csv file directly html table javascript, won't compatible across browsers. there easy way have datastore write out csv files? if can guarantee can export data in user request timeout can create doing in handler querying , creating csv send appropriate headers start download there might time these become big exports should use task queue. the task query , write blobstore or gcs when ready notify user ready download. can make push channel api it's instant. flow be: click export button create channel connection , show loading icon run task channel id , needed info create when done send message channel onreceive download complete location.href=your.csv this sample, can improve it not require wait , show link when refreshed or something.

Detecting if a file is a video in Python? -

is there python library can use detect if file video? letting users upload videos site , want prevent images , documents , except video filetypes. plan right upload file, test it, if isn't video delete it, if process through normal pipeline. i'd love test corrupt video somehow matter. i need able support videos without extensions. had thought mimetypes library when following: import mimetypes url = 'http://thehighlightnetwork.appspot.com/serve/amifv94nsd5muowe60rnmssbkvusgilnynjzawl30crqvnlad7hknemmdbqcmhiaoxc0n9onngjam19ttvenepjawpeqz6dq25cwjd5dzqxok0c4iapum_l-83eqs4seunqoceylehtskfkhfc8bxzjqtlya99g2nn9lrfcxwrngyptjdezeteq' print mimetypes.guess_type(url) i get: (none, none) i using google app engine have built in libraries can add too. install python-magic , os-independent pip install python-magic dependencies windows , osx on windows, need download , save following libraries under c:\windows\system32: regex2.dll sourceforge.net/pro

android - Using youtube to play in app purchasble videos -

is possible use youtube api on adroid play video available after in app purchase? for example have teaser video, free. , full video sold user. having trouble setting web server stream .3gp files app (by trouble mean lost). will youtube let me keep videos private, since trying sell them? if not possible have advice on how set webserver stream .3gp videos? (i know little servers) while can set youtube videos unlisted, use of youtube in way going violation of api's terms of service . note cannot officially interpret tos you, seems against provision: you agree not use youtube api of following commercial uses unless obtain youtube's prior written approval: the sale of youtube api, api data, youtube audiovisual content or related services, or access of foregoing; there number of ways stream video server, , i'm not sure can give comprehensive answer. however, here's 1 possible approach consuming video android side. on server side,

java - Is Time Check possible inside while true Thread condition -

good day of . i have thread shown below , in while true condition , continuously checks data inside hashset , if present extracts , , incase there no symbols 5 minutes in hashset (here question how can keep such condition in below else block possible ) package com; import java.util.hashset; public class tester extends thread { hashset<string> set = new hashset<string>(); public void run() { while (true) { try { if (set.size() > 0) { // extract , set.clear(); } else { // if there no elements in set more 5 minutes execute task // here question , keep such check possible or not } thread.sleep(2000); } catch (exception e) { } } } public static void main(string args[]) { try { tester qt = new tester();

Distinguish red color from white is HSV or similar color space? -

red color has h=0 in hsv color space . white color has h=0, s=0, v=1 . i.e. h(red)=h(white) . so, if comparing colors hue, how calculate "likelihood" coefficient take account white color not red (or white color hues). in hsv color space s channel represents color saturation. s==0 means color shade of gray (regardless of h , higher v is, brighter is). larger s value is, less grayish gets. want @ v value, since if v==0 you'll have black pixel regardless of h & s . when want compare 2 colors should use 3 channels, may wait them differently don't want omit of them.

ios - iPad Bookmark Icons on a Cake PHP Site -

how can setup ipad/iphone bookmark icon on cakephp site? using correct filename - apple-touch-icon.png - , have tried uploading /webroot , directory above /webroot no avail. tried searching google of course. has done this? thanks! sharkofmirkwood's answer worked perfectly. i added: <link rel="apple-touch-icon" href="../img/apple-touch-icon.png" /> to view/layouts/default.ctp thank you!

c# - Load certificate keys into CngKey class for use with DiffieHellman (ECDiffieHellmanCng class) -

this related .net / c#. lets assume there certificate + private key (p521 ecc one) inside pfx or pkcs#12 file. have loaded certificate , it's private key windows certificate store installing (either double clicking pfx or running certutil -f -p mypfxpassword -importpfx someeccert.pfx ). have noted if certificate compatible (eg. p521 curve), automatically installed cng certificate/key. now, how can load private key cngkey can use inside ecdiffiehellmancng class? load x509 (cng) certificate read it's serial #, issuer, common name etc bookkeeping. var mycngkey = somehowloadthecngkey("my ecc certificate"); // <== ?? var mydh = new ecdiffiehellmancng(mycngkey); well, .net's doesn't have api cng. if scratch surface of api see it's kinda ridiculous, considering both microsoft , cng serious of crypto apis on entire windows platform. so need use clrsecurity provides c# interfaces (via p/invoke) c++ cng api. it's not nicest of api designs

Speeding up Python Imports -

i have large program structured using object oriented techniques, , have 1 main driver module imports bunch of other classes, in turn import more python built-in modules or other classes. there on 250 from x import y statements (i don't have control on part of code), duplicates in other classes , unique. profiled code , suspected majority of time in start import many modules , classes. there way speed this? you can move import statements inside functions reduce initial startup. another technique copy modules ramdisk or tmpfs faster io (these use ram, runs faster).

Algorithm for counting n-element subsets of m-element set divisible by k -

suppose {1, 2, 3, ..., m} set. choose n distinct elements set. can write algorithm counts number of such subsets sum divisible k (ordering not mattering)? this problem have been easier if ordering mattered, doesn't , don't have clue how approach. can please help? this can done in time o(n·k·m) , space o(n·k) method similar outlined below. let s set m elements. definition of set , subset , elements of s distinct, elements of s-subset. first, consider simpler problem count s-subsets number of elements instead of n elements. let n(w,r) number of w-subsets u such Σu (the sum of elements of u) equal r mod k. if w subset of s, let w' w + z, z ∈ s\w; is, z element of s not in w. n(w', (r+z)%k) = n(w, (r+z)%k) + n(w, r) because n(w, (r+z)%k) number of w'-subsets u Σu≡(r+z)%k) don't contain z , n(w, r) number of w'-subsets u Σu≡(r+z)%k) contain z. repeat construction, treating each element of s in turn until w' = s, @ point desired answer