Posts

Showing posts from May, 2011

.net - psexec and process.start, waitforexit -

.net - psexec and process.start, waitforexit - task : re-create file remote pc remote pc using admin account code : psi.filename = "cmd.exe" psi.arguments = parastr psi.username = struserid psi.password = converttosecurestring(txtadminpassword.text) psi.domain = strdomain psi.windowstyle = processwindowstyle.normal psi.useshellexecute = false dim proc new process proc.startinfo = psi proc.start() parastr= /k psexec.exe -h /user adminuser \sourcemachine cmd /c re-create \sourcepc\file1 \destpc\folder so when executing command, prompts admin password , 1 time verified , copies file , end this working fine i want check when actual re-create work done (the files size unknown , sometime takes more 3/4 hrs) i maintain cmd window open see if process over, homecoming message task completed or failed in command prompt how can check through vb , when process on ? on console application can set process exit co...

How can I built in a trace ability to python calls? -

How can I built in a trace ability to python calls? - suppose have python code, e.g. class defined somewhere, which cannot modified class myclass(object): def __init__(self, arg1, arg2): do_something... def foo(self): do_something now want add together trace capability, e.g. mechanism outside traces each , every method phone call above class. want able print out when e.g, __init__ has been called, or foo or __del__ method of myclass . is possible do, , how done best? create proxy class wraps original class , delegates work after printing trace: class myclassproxy(object): def __init__(*args, **kwds): print 'initializing' self.o = myclass(*args, **kwds) def foo(self): print 'fooing' homecoming self.o.foo() python python-2.7 trace

ldap search filter query to extract user group information -

ldap search filter query to extract user group information - currently in deployment, want extract user-group info part of search query? of doing top level search, results in downloading finish ldap user-profile info ldap server. kind of overhead, possible include search filter in search query can give me direct user-group membership lone , not finish user-profile? thanks help on this. the "member" attributes on groups provide dn of members of group. if looking @ user vs group, there no standard seeing groups relations user. (ad , edirectory) back upwards degree. nested groups in ldap can cause more work find user-group relations. ldap ldap-query

java - Fibbonacci sequence -

java - Fibbonacci sequence - i'm having little troubling understanding code below. i've worked out vales each of variables each loop , understand how values each variable alter after each loop i'm confused how int = b; represents sum of 2 previous values. stuck on problem long time , solved problem through trial , error. i don't understand how int = b; represents sum of 2 previous values. convinced since int c = + b; sums both variable , variable b variable wanted print in program. can explain how int represents sum of 2 previous values , why int c not. public class fibonacci extends consoleprogram{ public void run(){ int = 0; int = 0; int b = 1; while ( <= 12) { println(a); i++; int c = + b; = b; b = c; } } } i think of staircase: 0 0 + 1 = 1 1 + 1 = 2 1 + 2 = 3 2 + 3 = 5 3 + 5 = 8 5 + 8 = 13 an arbitrary step like: ...

Hide status bar in Android 2 but keep Action Bar in Android 3/4 -

Hide status bar in Android 2 but keep Action Bar in Android 3/4 - i have been trying out various ways no success. doing total screen painting app kids. can't go total screen without next line in manifest.xml: android:theme="@android:style/theme.notitlebar.fullscreen" but statement causes lot of behaviour issues in android 3/4 phone/tablets. either action bar disappeared, or got total screen without access menu. removing line , next code: requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); works android 3/4 phones, have status bar on android 2! how can remove status bar on android 2 still back upwards android 3/4? thanks! you can using values-v11 folder. in manifest: android:theme="@style/mytheme" values/styles.xml: <style name="mytheme" parent="android:theme.notitlebar.fullscreen"...

delegates - How to wrap every WCF call in a try-catch block -

delegates - How to wrap every WCF call in a try-catch block - i have website need create asynchronous calls wcf service. want wrap each phone call in try-catch block can deal timeoutexceptions , communicationexceptions. however, don't want copy-paste exact same try-catch block every time create phone call service. there way can utilize delegates write try-catch block once? still want capture exception messages. i want phone call like: // method returns void trycatchhelper(x => x.wcfmethod1(param1, param2)); // method has homecoming value no params var returnvalue = trycatchhelper(x => x.wcfmethod2()); edit: here's code looks now: user getuser(int id) { user returnuser = null; seek { // open wcf channel, etc. returnuser = mywcfclient.getuser(id); } grab (timeoutexception exception) { log(exception.message); // abort wcf mill } grab (communicationexception exception) { ...

javascript - creating account by data from spreadsheet - google apps -

javascript - creating account by data from spreadsheet - google apps - i working on simple script creates business relationship in command panel of domain - illustration gmail - , looking function in google apps script creates business relationship automatically on inserting info spreadsheet i searched net , did find though : https://developers.google.com/apps-script/class_usermanager , method using : var user = usermanager.createuser("john.smith", "john", "smith", "password question is, how can insert parameters spreadsheet have. sorry if sounds bit stupid i'm new google apps script. to read spreadsheet, utilize spreadsheetapp. an illustration of reading set of rows. (let's rows). var sheet = spreadsheetapp.getactivesheet(); var info = sheet.getdatarange().getvalues(); .getvalues() returns 2d array. access data[rownum][colnum] . let's want add together every row new user, do for (var in data) { use...

Force update Amazon CloudFront on iOS -

Force update Amazon CloudFront on iOS - i using amazon s3 in conjunction amazon cloudfront, in app have method update s3 object, s3 object using cloudfront, create alter info , reupload under same key -- replacing/updating file/object. however, cloudfront doesn't seem update along s3 (well does, users don't have day), there way forcefulness cloudfront content update? apparently can invalidate it, there ios sdk way that? i don't know there way create cloudfront invalidation request via ios sdk. need build own method formulate request against aws api. i suggest take approach. invalidation requests expensive operations (relative other cloudfront costs). not want leave user able initiate unlimited amount of invalidation requests against cloudfront via application. run against limits number of concurrent invalidation requests can have. best best implement file name versioning scheme can alter file name in programmatic way each revision. reference new u...

javascript - Conflict between scriptmanager and rokbox -

javascript - Conflict between scriptmanager and rokbox - i'm trying utilize rokbox display images on page asp: scriptmanager preventing working. when comment out code: <asp:scriptmanager id="scriptmanager1" runat="server" enablepagemethods="true"> <scripts> <asp:scriptreference path="~/scripts/jquery-1.9.0.min.js" /> </scripts> </asp:scriptmanager> the rokbox script runs. rokbox code is: <script type="text/javascript" src="rokbox/mootools-release-1.11.js"></script> <script type="text/javascript" src="rokbox/rokbox.js"></script> <script type="text/javascript" src="rokbox/rokbox-mt1.2.js"></script> <link href="rokbox/themes/dark/rokbox-style.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="rokbox/themes/da...

asp.net mvc - Knockout JS - one way binding in order to keep server values? -

asp.net mvc - Knockout JS - one way binding in order to keep server values? - i'm setting form in knockout within mvc application , displaying info database, such as: @html.editorfor(model => model.addresspostcode) // filled in controller. this fine, expected. however, i've worked lot knockout js , want value used within search of mine (and thus, data-bind="value: postcode" on postcode element. the problem? well, when bind postcode: ko.observable('') , pre-populated server value gets replaced '' (as you'd expect really). there way around this? the value binding overriding predefined value, think antipattern utilize both server side mvc , client side mvvm, if want take route need create own binding like ko.bindinghandlers.valuewithinit = { init: function(element, valueaccessor, allbindingsaccessor, context) { var observable = valueaccessor(); var value = element.value; observable(value); ...

In MongoDB how to search in arrays for sequences and complex searches -

In MongoDB how to search in arrays for sequences and complex searches - i want able search in documents subsequences. for example { "name": "doc1", "sequence": ["a", "b", "d", "g", "k"] } { "name": "doc2", "sequence": ["c", "a", "b", "m", "d"] } i want match multiple items in order. queries example: return documents have sequence ["a","b"]. (returns doc1 , doc2) return documents have "a" , after 3 positions "d" (return doc2) return documents have sequence ["b","d","(whatever)", "k"] (return doc1) i not sure can mongodb. solution save sequences strings instead of arrays , utilize regular expressions (but don't much solution). if can't in mongodb, there nosql engine or whatever engine supports this? i think ...

testing - Invalid JSON in Playframework 2.1 Test POST Request -

testing - Invalid JSON in Playframework 2.1 Test POST Request - i trying test post route (on playframework 2.1/ java) , maintain getting bad request - invalid json response. please allow me know doing wrong. test code below. running(fakeapplication(), new runnable() { public void run() { map map = new hashmap(); map.put("key1", "val1"); map.put("key2", 2); map.put("key3", true); jsonnode df= json.tojson(map); result result = route (fakerequest(post, "/item").withheader("content-type", "application/json").withsession(accounttest.user_key, "some key") .withsession(accounttest.provider_key, "facebook").withjsonbody(df)); logger.debug("result " + contentasstring(result)); system.out.println("result "...

Access an attribute value from another jsp In jquery -

Access an attribute value from another jsp In jquery - i have 2 jsp's. editattribute.jsp & securitysetting.jsp and having hidden variable in form posted in editattribute.jsp (which individual page). <input type="hidden" name="securitysetting" id="securitysetting" value=""> and have radio options in securitysetting.jsp(another page) i need set hidden variable value based on value selected in securitysettings.jsp var sectype = $("input:radio[name='sectype']:checked").val(); if (sectype == 'open') { $("#securitysetting").val("n"); console.log("in open" + $("#securitysetting").val()); } else if (sectype == 'restricted') { var sg = $("#sgrp").val(); $("#securitysetting").val(sg); console.log("in restricted" + $("#securitysetting").val()); } but nt command of $("#securitysetting") obj...

Android set wallpaper -

Android set wallpaper - i using wallpapermanager set image wallpaper. the problem image automatically enlarged , set ( ie entire image doesnt appear on screen). i have tried setting little images, also have tried scaling downwards images , setting them, none of them works. it seems image scaled , set. is there way resolve this?? you can utilize createscaledbitmap scale images. android wallpaper

performance - Which way of these two pattern matching is more preferred? -

performance - Which way of these two pattern matching is more preferred? - i'm curious, these 2 functions same thing. 1 should use? let f = match b -> a;; allow f = match b -> b;; or depends on preference? sense sec 1 improve i'm not sure. performance wise there no difference. style-wise b -> a bit problematic because have unused variable b . _ -> a create more sense. other that, it's preference. personally prefer _ -> a on b -> b because doesn't introduce variable. ps: assume in real code there more cases b - otherwise write let f = a . performance functional-programming pattern-matching ocaml preference

php - i don't know how to do an embedded relation between users and permission in sfguard -

php - i don't know how to do an embedded relation between users and permission in sfguard - i have sf_guard_user fields , want create embedded relation between permission , users in order have form, in sf_guard_user , able add together or modify permission users. you need create form class sfguarduserform . , within class, have widget called sf_guard_user_permission_list handle permissions relation. php symfony-1.4 sfguard

javascript - Correct way to document open-ended argument functions in JSDoc -

javascript - Correct way to document open-ended argument functions in JSDoc - let's have following: var somefunc = function() { // here arguments } how correctly document function can take number of arguments in jsdoc? best guess, i'm not sure it's correct. /** * @param {mixed} [...] unlimited amount of optional parameters */ var somefunc = function() { // here arguments } related to: php - how doc variable number of parameters i haven't been able find in jsdoc specs, it's worth... google's closure compiler way: @param {...number} var_args where "number" type of arguments expected. the finish usage of this, then, following: /** * @param {...*} var_args */ function lookmaimvariadic(var_args) { // utilize `arguments` object here, not `var_args`. } note comment utilizing arguments (or offset of arguments ) access additional arguments. var_args used signal ide argument indeed exist. search "va...

AppHarbor Web.config transforms not being applied -

AppHarbor Web.config transforms not being applied - i developing application in servicestack , trying sort out deployment on appharbor, reason web.config transforms not beingness applied. i had web.appharbor.config file , changed environment setting "appharbor" - 1 time failed work after several updates, gave , changed environment setting "release" , copied desired transformations web.release.config file. app gets deployed ok config settings not reflect values in transform file (i verify login on twitter , seeing callback url twitter auth still tries redirect me localhost, 1 of settings alter in transform file) i have tried transform tester tool , works expected. manually publishing web application local folder correctly applies transformations according selected configuration does have working? there obvious i'm missing? thanks it sounds web.release.config file not included in build output. need set build action attribute content i...

java - Syntax error on token in Eclipse -

java - Syntax error on token in Eclipse - i trying utilize random number generator little game writing. random generator in external class called main. i getting syntax error indicated below , cant tell why? help great! code: import java.util.random; public class randomgenerator { random generator = new random(); // error here is: syntax error on token ";", { (int = 0; < 2; i++) // expected after token { int r = generator.nextint(2); } } // error here telling me add together "}" public class randomgenerator { public static void main (string [] args) { random generator = new random (); (int = 0; < 2; i++) { int r = generator.nextint (2); } } } java

python 2.7 - Error in deploying my code to Google App Engine -

python 2.7 - Error in deploying my code to Google App Engine - my simple application fetches contents given url working fine on local server, on deployment gives error. check here the application consists of 2 files including here compare-hatke.py from google.appengine.api import urlfetch url = "http://www.google.com/" result = urlfetch.fetch(url) if result.status_code == 200: print(result.content) app.yaml application: compare-hatke version: 3 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: compare-hatke.app log - version 1 traceback (most recent phone call last): file "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 196, in handle handler = _config_handle.add_wsgi_middleware(self._loadhandler()) file "/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 269, in _loadhandler raise importerror('%s has no attribute %s...

ios - uitableviewcells, design concerns -

ios - uitableviewcells, design concerns - i think i'm not lucid anymore... want display info - retrieved server - in uitableview. created a wrapper class store info elements collected server. of them stored array. a uitableviewcell subclass display info custom cell a xib file, associated uitableviewcell defined in point 2) in cellforrowatindexpath: , dequeue instances of 2+3) associate fields of 1) counter parts in defined in 2). to me looks lot of stuff. but removing 1) seems difficult, dequeuereusablecellwithidentifier: manages it's own pool of objects, doesn't create sense create array of uitableviewcells in step 1) removing 3) may possible, adds over-head when setting cell in cellforrowatindexpath: anyone has found way trim-down on class crowd ? if cell not complex, can create code in controller displaying data. if cell has higher complexity, there isn't way trim down. besides 2 classes + resource file not much trying accomplish. ...

python - django model.delete() raises ValueError - needs to have a value for field before this many-to-many relationship can be used -

python - django model.delete() raises ValueError - needs to have a value for field before this many-to-many relationship can be used - i have overritten save_model() method in django modeladmin class. model has manytomany field. save_model looks this: def save_model(self, request, obj, form, change): creating = false to_delete = false if not obj.pk: creating = true obj.save() form.save_m2m() # observe (some complicated conditions) here ... detected =true if detected: obj.delete() # --> here problem traceback: file "/library/python/2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) file "/library/python/2.7/site-packages/django/contrib/admin/options.py" in wrapper 366. homecoming self.admin_site.admin_view(view)(*args, **kwargs) file "/...

jQuery Drag-n-Drop issue -

jQuery Drag-n-Drop issue - i have 2 div elements 1. div (id="draggable") & div (id="dropper"). each of them contains several div within them. want drag , drop kid draggable dropper. after did want move them around in dropper. far have managed things, can't accomplish lastly part. because kid draggable can move in whole document. can pls help me this? <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>new web project</title> <link href="css/jquery-ui-1.10.0.custom.css" rel="stylesheet" type="text/css"/> <link href="css/style.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="script/jquery-1.9.0.js"> </script> <script type="text/javascript" src="script/jquery-ui-1.10.0.custom.js"> </script...

ios - setting random localnotifications on iphone -

ios - setting random localnotifications on iphone - i trying find way schedule random local notifications on iphone. able send user random message (picked list of messages) @ random time during day, everyday. i can calculate bunch of random times , messages , schedule next 30 days or more, seems messy , doesn't allow way user able cancel alerts. my research shows cron jobs not supported on iphone , seems can't schedule background process maintain randomizing notifications, right? have looked force notifications possibility. however, wanted set question out there see if experts had other ideas. thanks! iphone ios objective-c notifications uilocalnotification

Searching nearest geo objects by google places api -

Searching nearest geo objects by google places api - i need write little programme create searching of category of objects (airports example) near geo point. places api have limit radius length of 50 000 meters. seems using of longer radius has no sense. but saw when opened google maps in browser , type 'airport' in search input i'll got airports google found in map part bounded browser window. if want more airports i'll zoom out , receive results bigger region. seems google has tools kind of searching. so question - how can kind of searching using google maps api, searching radius more 50 000 meters? let me know if find proper solution. can think of work around load airports/category objects , setcenter geo point , set zoom in plenty can focus 1 or 2 near airport/object geo point have. google-maps google-places-api

asp.net - hyperlink in in checkboxfield detailsview -

asp.net - hyperlink in in checkboxfield detailsview - in detailsview control, have several checkedboxfield boolean = true. want have hyperlink on text such headertext of datafield in order navigate other page. possible? if not, suggestion? for mode details, when click hyperlink in gridview, detailsview show details checkbox checked if boolean=true , unchecked if false. want have hyperlink text on checked checkedboxfield (unchecked checkbox hide code behind). below aspx: `   <fields> <asp:checkboxfield datafield="sample_preparation_sp" headerimageurl="~/images/coal/coal.jpg" headertext="sample_preparation" text="sample_preparation" /> <asp:checkboxfield datafield="free_moisture_fm" headerimageurl="~/images/biomass/wood chips.jpg" headertext="free_moisture_fm" sor...

Enhance current SQLite query -

Enhance current SQLite query - i inherited old sqlite database should not alter (this requirement). there many tables, focus on 2 of them: songs ---------- song_id (primary autoincrement) group_id (external) title audio_file_path waspurchased (boolean, 0/1) groups ---------- group_id (primary autoincrement, related songs group_id) group_name at moment, application needs perform query: select song_id,title,audio_file_path,waspurchased,g.group_name groupname, g.group_id groupid songs s bring together groups g on s.group_id=g.group_id order groupname desc is there way, same query, extract how many distinct g.group_id have waspurchased=0? any help appreciated. select song_id,title,audio_file_path,waspurchased, g.group_name groupname, g.group_id groupid, sum (select distinct g.group_id yourtables/join waspurchased = 0) nb songs s bring together groups g on s.group_id=g.group_id order groupname desc not sure if it's best way(never trie...

Python Returns on calling class object -

Python Returns on calling class object - i'm making class in python called house. has instance variables such street name , and street number. h = house(1234, "main street") >>>h.street_name main street >>>h.street_number 1234 >>>h <__main__.house object @ 0x27ffbd0> when phone call "h", programme supposed homecoming "1234 main street" instead. how should approach problem? you want define __str__ method returns string representation. example: class house: # other methods def __str__(self): homecoming "%d %s" % (self.street_number, self.street_name) python class methods return

vb.net - How to split a string by using more than one delimiter -

vb.net - How to split a string by using more than one delimiter - below script used in ssis package. if (row.answertype.trim().toupper = "multiple select" , _ row.surveyquestionid = row.surveydefinitiondetailquestionnumber) dim question1 string = row.surveydefinitiondetailanswerchoices.toupper.trim() dim ans1 string = row.surveyanswer.toupper.trim() each x string in ans1.split(new [char]() {cchar(vbtab)}) if question1.contains(x) row.isskipped = false else row.isskipped = true 'row.isallowed = true row.errordesc = "invalid value in reply column multiple select!" end if next end if this script succeeds when having tab delimiter. need both tab , non tab characters delimiters. add needed characters character array ans1.split(new [char]() { cchar(vbtab), cchar(" "), cchar(";") }) or ans1.split(new [char]() { cchar(vbtab), ...

gnu make - Using variables in Makefile -

gnu make - Using variables in Makefile - here simple makefile. filename=test.`date +"%y.%m.%d %h:%m:%s"`.txt test: @echo ${filename} @sleep 2s @echo ${filename} the output of make test test.2013.02.18 15:30:23.txt test.2013.02.18 15:30:25.txt the problem filename beingness calculated each time used. want calculated 1 time , same while script running. doing wrong? gnu create has 2 flavours of variables. have used recursively-expanded variable, want simply-expanded variable. see http://www.gnu.org/software/make/manual/html_node/flavors.html#flavors with current makefile, variable contains exact text test. date +"%y.%m.%d %h:%m:%s" .txt , every time reference text gets substituted verbatim, , makefile equivalent to: test: @echo test.`date +"%y.%m.%d %h:%m:%s"`.txt @sleep 2s @echo test.`date +"%y.%m.%d %h:%m:%s"`.txt seen should obvious shell runs date command twice. to behaviour want,...

this - JavaScript: unexpected typeof result -

this - JavaScript: unexpected typeof result - i have array iterator function: function applycall(arr, fn) { fn.call(arr[0], 0, arr[0]); } and code var arr1 = ['blah']; applycall(arr1, function (i, val) { alert(typeof this); // object why?? alert(typeof val); // string alert(typeof(this === val)) // alerts false, expecting true }); why typeof this within inline function object instead of string ? jsfiddle here when method called in javascript, internally sets this calling object: https://developer.mozilla.org/en-us/docs/javascript/reference/global_objects/function/apply ...and primitive values boxed. by "boxed," mean primitive wrapped in object. note applies first argument apply / call . other arguments become function parameters not "boxed." javascript this typeof

asp.net - concatenate a string from multiple input textboxes -

asp.net - concatenate a string from multiple input textboxes - i have cshtml page inquire user provide input info need concatenate string build dynamic linq query in controller. view not utilize model. here html code far. <div id="filter"> come in client name. can part of name broader results. (optional) <br /> <input type="text", id="customer", value="") /> <br /> come in case status ( open or closed ), or leave blank both. (optional) <br /> <input type="text", id="status", value="") /> <br /> come in date range filter date. (optional) <br /> start date <input type="text", id="startdate", value="") /> end date <input type="text", id="enddate", value="") /> <br /> come in promoid (optional) <br /> <input type="text", id="promoid", value="...

c# - Sending multiple requests to a server using multithreading -

c# - Sending multiple requests to a server using multithreading - i have task form thousands of requests later sent server. server returns response each request , response dumped output file line line. the pseudo code goes this: //requests contains thousands of requests sent server string[] requests = getrequestsstring(); foreach(string request in requests) { string response = makewebrequest(request); parseanddump(response); } now, can seen serve handling requests 1 one. want create entire process fast. server in question capable of handling multiple requests @ time. want apply multi-threading , send let's 4 requests server @ time , dump response in same thread. can please give me pointer possible approaches. you can take advantage of task .net 4.0 , new toy httpclient , sample code below showed how send requests in parallel, dump response in same thread using continuewith : var httpclient = new httpclient(); var tasks = requests.select(r => ht...

ruby on rails - How can I extend interval time every time it runs? -

ruby on rails - How can I extend interval time every time it runs? - in application, every 10 seconds, calls ajax reload number of received mails. however, seems pc getting heated time goes by, when i'm doing nil staying @ same page in application. i'd add together extensional 10 more seconds every time runs. resets 0, when whole page loaded again. possible? refresh_mail_count.js jquery(document).ready(function () { refreshmail(); }); function refreshmail() { $.ajax({ url: "/messages/refresh_mail", type: "get", datatype: "script", }); } refresh_mail.js.erb $('#message_count').html("<%= j(render(:partial => 'layouts/message_received_count', :object => @message_count)) %>"); settimeout(refreshmail,10000); you can define global javascript variable on view. window.timercounter = 0 increment variable on refresh_mail.js.erb window.timercounter += 1 settimeout(ref...

My Ruby tests won't run -

My Ruby tests won't run - every 1 time in while, fire iterm 2, using zsh, work on tutorials. sometimes, when seek run ruby tests, don't run. nil gets returned. process never runs , have ctrl+c break out of it. here's command run: ruby -i test/unit/name_of_test.rb this happens of tests. have restart computer. ideas? i've tried using terminal, using zsh. i'm on os x, using ruby 1.9.3 , rails 3.2.8. this isn't ruby, iterm 2, terminal, or zsh problem. instead, it's not understanding how *nix os apps handle reading stdin. the problem you're seeing -i specifies $load_path directory. result, ruby using path/to/script load_path variable , hanging, waiting input stdin because didn't see script run. rather using cntrl+c, or restarting, utilize cntrl+d. closes input stream, cause ruby exit since found no commands run. you can test using: ruby -i /dev/null at command-line. ruby hang, waiting input. close input , ruby ex...

formatting - convertion of format in python -

formatting - convertion of format in python - i new python.i started python 2 weeks ago.now facing problem.i spent 3 days on this. i have info following >p1;gi|467971|gb|aa3.1| -maslaallpllallvlcrldpaqa qaepgagg-lqelalq---krgive qcctsicslyqlen--- * >p1;gi|307072|gb|aaa59179.1| -malwmrllpllallalwgpdpaaa fpk-tr-eapgags-legslq--kre qcctsicslyqlenycn * >p1;gi|387059|gb|aaa31.1| -malvlallalwntnqafvs-rhlc fyipk-drreg-lqlq---krgivd qcctgtctrhqlqs--- * how can convert these info looking following -maslaallpllallvlcrldpaqaqaepgagg-lqelalq---krgiveqcctsicslyqlen---,- malwmrllpllallalwgpdpaaafpk-tr-eapgags-legslq--kreqcctsicslyqlenycn,-malvlallalwntnqafvs-rhlcfyipk-drreg-lqlq---krgivdqcctgtctrhqlqs--- please help me. a kludgy way data "string": >>> lines = data.replace('*', ',').splitlines() >>> ''.join(line line in lines if line , not line.startswith('>')).rstrip(',') '-m...

javafx drawing lines and text -

javafx drawing lines and text - i've got problem drawing lines in javafx. we're making application simulating traffic - there 16 streets, , every street has different color dependent on traffic. there simple picture: http://img546.imageshack.us/img546/9949/uliceu.jpg my first thought on how draw streets lines , alter colors. cant set text on line (i want text street name). tried set line , text on stackpane. added stackpanes on borderpane center... didnt work. seems stackpane doesn't respect line's start x, start y... lines overlapped each other. main pane of app borderpane , want set map on center. doesn't need resized dynamically, have 1 map can positioned in static way. i need that: http://img834.imageshack.us/img834/1157/ulicac.jpg streets need connect each other... on first picture have suggestions on how that? tips appreciated :) like that: group gr = new group(); text text = new text("1st street"); text.setfill(color.we...

Growing a list with variable names in R -

Growing a list with variable names in R - i trying grow list in r, both value , name of each entry held in variable, doesn't seem work. my_models_names <- names(my_models) my_rocs=list() (modl in my_models_names) { my_probs <- testpred[[modl]]$y1 my_roc <- roc(ytst, my_probs) c(my_rocs, modl=my_roc) # <-- modl , my_roc both variables } my list my_rocs empty @ end, though know loop iterates ( my_roc filled in) why? on related note, there way without looping? generally in r, growing objects bad. increases amount of memory used on starting total object , filling in. seems know size of list should in advance. for example: my_keys <- letters[1:3] mylist <- vector(mode="list", length=length(my_keys)) names(mylist) <- my_keys mylist ## $a ## null ## $b ## null ## $c ## null you can assignment way: key <- "a" mylist[[key]] <- 5 mylist ## $a ## [1] 5 ## ## $b ## null ## ## $c ## null ...

c# - read message queue sent time from MSMQ Journal -

c# - read message queue sent time from MSMQ Journal - i have msmq enabled journal. , due fact receive more 1000 messages per day want clear journal maintain messages lastly 2 days. therfore want read messages , check senttime property against "current date - 2 days". @ moment programme stop property senttime wont provided. error: "propertyfilter isn't set correctly" the code: class programme { static void main(string[] args) { string queuename = ".\\private$\\test;journal"; messagequeue msgqueue = new messagequeue(queuename); message[] messages = msgqueue.getallmessages(); try{ foreach (message msg in messages){ //if(msg.senttime < datetime.today.adddays(-2)){ console.writeline(msg.senttime); //} } }catch (exception e){ console.writeline(e.message); } console.read(); } } ...

mingw - python + import C++ coding help. Missing compiler_cxx fix for MSVCCompiler; Unable to find vcvarsall.bat -

mingw - python + import C++ coding help. Missing compiler_cxx fix for MSVCCompiler; Unable to find vcvarsall.bat - i have scipy , numpy. installed mingw cygwin . added path o mingw environmental variables. when run python code shows error message. *no module named msvccompiler in numpy.distutils; trying distutils missing compiler_cxx prepare msvccompiler* traceback (most recent phone call last): file "c:\python27\jicrd_simulation.py", line 633, in <module> cprofile.run('run()','infoprof_c_old') file "c:\python27\lib\cprofile.py", line 29, in run prof = prof.run(statement) file "c:\python27\lib\cprofile.py", line 135, in run homecoming self.runctx(cmd, dict, dict) file "c:\python27\lib\cprofile.py", line 140, in runctx exec cmd in globals, locals file "<string>", line 1, in <module> file "c:\python27\jicrd_simulation.py", line 615, in run p,tr...

c# - NET4 features: should casting generic IEnumerable to IEnumerable be possible? -

c# - NET4 features: should casting generic IEnumerable<T> to IEnumerable<MoreSpecificT> be possible? - if have internal method in .net 4 library (running on mono here): protected internal ienumerable<kscomponent> getcomponentsbytype(type componenttype) { homecoming this.componentsdic [componenttype]; } and expose generic parameter simple usage. have done far , working: public ienumerable<tcomponenttype> getcomponentsbytype<tcomponenttype>() tcomponenttype : kscomponent { homecoming this.getcomponentsbytype (typeof(tcomponenttype)).cast<tcomponenttype>(); } however, shouldn't .net 4.0 work: public ienumerable<tcomponenttype> getcomponentsbytype<tcomponenttype>() tcomponenttype : kscomponent { homecoming (ienumerable<tcomponenttype>)this.getcomponentsbytype (typeof(tcomponenttype)); } edit: kscomponent base of operations class, tcomponenttype can (e.g.) ksmovecomponent , s...

How can I plot graph for sample variance versus sample size while putting random numbers from 1 to 20 in R language -

How can I plot graph for sample variance versus sample size while putting random numbers from 1 to 20 in R language - how can plot graph sample variance versus sample size while putting random numbers 1 20 in r language? trinker hate answered this, here rough illustration many assumptions: sample.max <- 20000 sample.sizes <- seq(1, sample.max, by=10) myfun <- function (x){ var(sample(1:20, x, replace=true)) } variances <- sapply(sample.sizes, myfun) plot(sample.sizes, variances, t='l') r

c++ easy way to convert macro variable to wchar string literal -

c++ easy way to convert macro variable to wchar string literal - in next example, remove std::wstring(std::widen(...)) part, '#' macro returns char string literal -- there way accommodate wchar? #define foo_macro(classname)\ struct classname##factory : public otherclass {\ // stuff here\ } classname##factory;\ somemap->add(std::wstring(std::widen(#classname), classname##factory))) how same thing using wchar? you utilize l prefix on string literal create wchar string literal: #define cat(a, b) a##b #define wstring(a) cat(l, #a) c++ macros

actionscript 3 - Preventing Application scale from cutting off button labels in Flex 3 -

actionscript 3 - Preventing Application scale from cutting off button labels in Flex 3 - i've encountered problem that's driving me nuts. apparently button labels not scale appropriately in flex or i'm not going correctly. simple runnable test case below. the issue: in test case can see button label cutting off @ end @ multiple different window sizes "pops" new font level seems , looks correct? why this? <?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:script> <![cdata[ import mx.events.resizeevent; public var minscale:number = 0.5; public var basewidth:number = 1000; public var baseheight:number = 800; override protected function updatedisplaylist(unscaledwidth:number, unscaledheight:number):void { super.updatedispla...

java - JSF CSV download in bean -

java - JSF CSV download in bean - i trying csv download in same fashion here: how stream file download in jsf backing bean? my response keeps throwing nullpointerexception @ output.write() line. bean of request scope. thoughts null pointer? seek { //submitform(); facescontext fc = facescontext.getcurrentinstance(); httpservletresponse response = (httpservletresponse) fc.getexternalcontext().getresponse(); response.reset(); response.setcontenttype("text/csv"); //response.setcontentlength(contentlength); response.setheader ( "content-disposition", "attachment; filename=\"reporting-" + new date().gettime() + ".csv\"" ); outputstream output = response.getoutputstream(); string s = "\"project #\",\"project name\",\"product feature(s)\","; s+="\"project status\...

checkbox - How to get dynamic selected value from dynamic view in android? -

checkbox - How to get dynamic selected value from dynamic view in android? - this question exact duplicate of: how dynamic created checkbox selected value view position in android how selected checkbox value dynamic created checkbox in linearlayout. please help me out. you can utilize on checkedchange listner on checkbox. example: chkbox.setoncheckedchangelistener(new oncheckedchangelistener() { @override public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { if (ischecked) { //do operations when checked } } }); android checkbox

Convert SQL into DQL (Doctrine2) with join table -

Convert SQL into DQL (Doctrine2) with join table - similar questions exist, found none mentionning silent bring together table problem. i have simple sql query bring together can't convert dql, because of bring together table. there 2 entities, shop , client, linked manytomany association. doctrine2 silently made bring together table: shop_client . now, if want all clients not belong given shop simlpy do: select c.name `client` c bring together `shop_client` sc on sc.client_id = c.id , sc.shop_id != :shop_id this straight forward, easy, cannot come dql version. i tried utilize "exists", "not in", "size" never end working dql query. edit: shop entity has clients field, client entity has no shops field. select c client c c.id in ( select c2.id shop s2 bring together s2.clients c2 s2.id != :shopid ) also, conside...

actionbarsherlock - android backup agent and SherlockMapActivity -

actionbarsherlock - android backup agent and SherlockMapActivity - i seek implement backup agent in android app, , i've got weird issue every times restore (at first launch) : unable resolve superclass of lcom/actionbarsherlock/app/sherlockmapactivity; (916) link of class 'lcom/actionbarsherlock/app/sherlockmapactivity;' failed unable resolve superclass of lnet/myapp/activity/impl/mapactivity; (674) link of class 'lnet/myapp/activity/impl/mapactivity;' failed not find class 'net.myapp.activity.impl.mapactivity', referenced method net.myapp.helper.slidingmenuhelper.<clinit> vfy: unable resolve const-class 1520 (lnet/myapp/activity/impl/mapactivity;) in lnet/myapp/helper/slidingmenuhelper; vfy: replacing opcode 0x1c @ 0x0081 exception ljava/lang/noclassdeffounderror; thrown while initializing lnet/myapp/helper/slidingmenuhelper; complete log here : https://gist.github.com/romainguefveneu/1acc78cabbed65fba4b7 the restore process works ...

sqlite - How to print query executed by query() method of android -

sqlite - How to print query executed by query() method of android - we pass many parameters query() method of android. android has simplified our work giving query method. there way can print sql query android form query method arguments android creates , sends sqlite. according previous post tried , got solution print query in log. use buildquerystring method of sqlitequerybuilder. takes same parameters query() method takes ......... string sqlqry = sqlitequerybuilder.buildquerystring(false,table_name, null, column_name_patientid +"="+ patientid, null, null, column_name_patientfirstname, null); log.i(tag, sqlqry); cursor = db.query(table_name, null, column_name_patientid +"="+ patientid, null, null, null, column_name_patientfirstname); thanks replies ...... android sqlite

facebook token expiration issue -

facebook token expiration issue - i've integrated facebook app using facebooker2 , mogli. offline_access removed facebook. i'm able token getting expire in 2 hrs, if user logged out facebook, expired. i wanted renew tokens can not next code https://graph.facebook.com/oauth/access_token? client_id=app_id& client_secret=app_secret& grant_type=fb_exchange_token& fb_exchange_token=existing_access_token as not when user logged out user. if how can know when user logged out facebook , still can not exchange tocken expired. , access_token works before expiration of token. any idea, if have 60 days expiration token or renew token before expired. thanks in advance help able provide. facebook-graph-api facebook-access-token facebooker2

Can you use an intent to launch Adobe Reader or the Docs Reader to open an specific PDF in an Android machine? -

Can you use an intent to launch Adobe Reader or the Docs Reader to open an specific PDF in an Android machine? - on site targeting android os, there way create link cause os open pdf downloaded site? is, without requiring user manually open pdf? edit: clarify, want implement similar on site: <a href="adobe_reader/foo.pdf">click here open foo.pdf on android!</a> this supposed link on site makes adobe (or another) launch foo.pdf , stored on android device. they should. seek this: intent intent = new intent(intent.action_view); intent.setdataandtype(path, "application/pdf"); startactivity(intent); if app has registered able view pdfs (and both of should have), launch them. or other app installed claims able read pdfs. android android-intent google-docs adobe-reader

symfony2 - Using sfGuard and FOSUserBundle in paraller -

symfony2 - Using sfGuard and FOSUserBundle in paraller - our client uses multiple applications developed symfony. older utilize symfony 1.3.x , newer symfony 2.x. user management , security based on sfguard using propel. client has created own bundle handling security sfguard based orm-objects in symfony 2. client wants upgrade user management component. current user management made automatic crud-app-generation symfony 1.x. upgrading user management symfony 2 using fosuserbundle seems reasonable solution, possible utilize existing symfony 1.x apps sfguard-plugin handling user management fosuserbundle? i'm quite new symfony, appreciate clear guidelines resolve issue 1 way or another. fosuserbundle utilize kind of password storage. i'm sure fosuserbundle not able check passwords created sfguard. maybe can utilize https://github.com/friendsofsymfony/fosadvancedencoderbundle alter password encoder fosuserbundle. symfony2 symfony1 fosuserbundle sfgua...

Creating a function in SQL Azure master database -

Creating a function in SQL Azure master database - is there anyway create user defined function in sql azure master database? how command on sql azure master database including write permissons? thanks jags unfortunately cannot command of master database -- master database read-only , used maintain logins/security info (and think other meta info that's auto-managed). see article sql-azure

php - Error With Using (int) and (double) together to Cut off Decimals -

php - Error With Using (int) and (double) together to Cut off Decimals - when using (int) (double) times not working correct. @ php code example: i need leave 2 decimals , remove other... i know number_format(); function cannot utilize it. because rounding number number_format(24.299,2); output: 24.30 need: 24.29 <?php $str="158.2"; echo (double)$str; // output: 158.2 echo (double)$str*100; // output: 15820 echo (int)((double)$str*100); // output: 15819 <-why? must 15820, why 15819? echo ((int)((double)$str*100)/100); // output: 158.19 ?> i need leave 2 decimals in number , cutting other without rounding. because of floating point precision (see illustration question: php math precision), 158.2 * 100 not exactly 15820 15819.99999999 . now (int) type conversion, not rounding, , digits after point cutting of. i need leave 2 decimals in number , cutting other without rounding. this easy: number_format($str, 2); update ...

database - Viewing seed results in rails console -

database - Viewing seed results in rails console - i have created seed file, ran rake db:migrate , rake db:seed seemed have run fine. however, view seeds in rails console, name of table usersinfo . how view verify seeds populated correctly in console? i have tried usersinfo.all in console got next error. undefined method `all' as far know, cannot straight view tables rails console, can check if table has info via associated activerecord model of table ex: if table name usersinfo should have model called class userinfo < activerecord::base set_table_name :usersinfo end and in console userinfo.all note: per rails convention, table name should plural, if not using rails convention, set table name via set_table_name: method and also, .all activerecord class methods , works activerecord model ruby-on-rails database testing seeding

android - When to commit application settings to SharedPreferences (onStop or onDestroy) -

android - When to commit application settings to SharedPreferences (onStop or onDestroy) - i wondering, when suitable time save our application settings sharedpreferences. should during onstop , or ondestroy ? realize both methods have pros , cons. onstop if user intention not quitting application, save application settings sharedpreferences seem redundant. simply press home (onstop called) -> long press home -> relaunch application select application again ondestroy user can kill application press home (onstop called) -> long press home -> swipe left on application kill it. if user quit application way, realize ondestroy not beingness called although app killed. hence, application settings not beingness saved. so, improve save application settings, during onstop or ondestroy ? it best phone call commit() either right after you've made changes, or in onpause() method. ensures changes saved in pretty much every scenario, except uncaught excep...

printing - Print to Zebra printer in php -

printing - Print to Zebra printer in php - looking proper code print php web page zebra ip printer using raw port 9100. know if possible? need send string in zpl formatted output direct zm400 label printer. i've searched high , low, closest i've found this: print straight network printer using php it seems close need, when php page hits code, doesn't anything. here's code used: <?php $handle = printer_open('\\\\192.168.2.206:9100\\'); printer_set_option($handle, printer_mode, "raw"); printer_write($handle, "text print"); printer_close($handle); ?> if you're looking send zpl printer, don't need dedicated printing library. need open socket printer , send zpl directly. more of general php socket-communication question opposed printer-specific question. if server hosting web app , printers on same network, able open socket , send zpl. if, however, printers , web app server on different...

html - Fluid height main body with header and footer -

html - Fluid height main body with header and footer - what trying have header @ top of page , footer @ bottom, map total availiable space in-between. want header , footer have fixed heights px not %. however, @ moment because set main map 100% forces footer off bottom of page , introduces scroll bar. this illustration code: http://jsfiddle.net/w4mxp/20/ css html, body { height: 100%; width: 100%; } #topbar { height: 50px; width: 100%; background-color: black; padding-left: 50px; padding-right: 50px; } #main { height: 100%; width: 100%; background-color: green; } #bottombar { height: 25px; width: 100%; background-color: black; padding-left: 50px; padding-right: 50px; } .left {float: left;} .right {float: right;} html <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="https://maps....

php - Is it possible to filter an array of select values from a form? -

php - Is it possible to filter an array of select values from a form? - say have form: <form method="post"> <select name="s[]" multiple="multiple"> <option value="12345678">one</option> <option value="a7e6b65e">two</option> <option value="ad2445f7">three</option> <option value="998d64fe">four</option> </select> <input type="submit" value="go"> </form> once form submitted, can utilize 1 of filters functions create sure info ok? first thought filter_input_array , don't think that's it. the way see, first check if have array, cycle through values: $s_clean = array(); if (isset($_post['s']) && is_array($_post['s'])) { foreach ($_post['s'] $o) { $s_clean[] = filter_var($o, filter_validate_regexp, array('options' => array('r...

c# - How to check if process is still running before calling Process.GetProcessById? -

c# - How to check if process is still running before calling Process.GetProcessById? - in .net process.getprocessbyid throws exception if process id not running. how safely phone call method won't throw exception? thinking like if(process.isrunning(id)) homecoming process.getprocessbyid(id); else homecoming null; //or else but can't find method check id, other getting running processes , check whether id exist in list. public process getprocbyid(int id) { process[] processlist = process.getprocesses(); homecoming processlist.firstordefault(pr => pr.id == id); } i looked within process.getprocessbyid method. it uses internal static class processmanager ensure, process runs. processmanager gets processes running in scheme , checks there ids, think best way it. so should consider overhead of exception or overhead of process array. c# .net system.diagnostics

Can one enable or disable a mailbox with the EWS Managed API? -

Can one enable or disable a mailbox with the EWS Managed API? - one can create, enable , disable mailbox using powershell commands. possible same using ews managed api? no, ews web service has nil mailbox creation. here can find operations supported ews. [exchange server 2007] http://msdn.microsoft.com/en-us/library/exchange/bb409286%28v=exchg.80%29.aspx [exchange server 2010] http://msdn.microsoft.com/en-us/library/exchange/bb409286%28v=exchg.140%29.aspx [exchange server 2013] http://msdn.microsoft.com/en-us/library/exchange/bb409286%28v=exchg.150%29.aspx you can write c# application create,enable,disable mailbox using powershell ews ews-managed-api

unicode - UnicodeEncodeError at /admin/ in Django app -

unicode - UnicodeEncodeError at /admin/ in Django app - i next error @ admin pages when seek view list of existing objects. unicodeencodeerror @ /admin/character/charlevel/ 'ascii' codec can't encode character u'\xd6' in position 0: ordinal not in range(128) request method: request url: http://127.0.0.1:8000/admin/character/charlevel/ django version: 1.4.1 exception type: unicodeencodeerror exception value: 'ascii' codec can't encode character u'\xd6' in position 0: ordinal not in range(128) exception location: /home/***/workspace/***/***/character/models.py in __unicode__, line 413 python executable: /usr/bin/python python version: 2.7.3 this occurs when open object list of class: class charlevel(models.model): char = models.foreignkey(character) prof = models.foreignkey(profession) level = models.smallintegerfield() def __unicode__(self): homecoming ('{c}/{l}/{p}'...

c++ - Scaling bitmap output distorts image -

c++ - Scaling bitmap output distorts image - i have 2752x2200 bitmap image. can display 1/3 of on mfc dialog box (for obvious size issues), if don't scale image top-left 917x733 block (the top-left 1/3 block). want zoom image out factor of 3 whole image dislayed in area size of 1/3 of image. have set grayscale bitmap so: ////////////////////////////////////////////////////////////////////////// ////////// setup bitmap //////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// //// fileheader //// bitmapfileheader* bf = new bitmapfileheader; bf->bftype = 0x4d42; bf->bfsize = 6054400 + 54 + sizeof(bitmapinfo); bf->bfoffbits = 54; //// infoheader //// bitmapinfoheader* bi = new bitmapinfoheader; bi->bisize = 40; bi->biwidth = 2752; bi->biheight = -2200; bi->biplanes = 1; bi->bibitcount = 8; bi->bicompression = 0; ...

How to configure WSO2 ESB SAP Adapter -

How to configure WSO2 ESB SAP Adapter - i have checked info related wso2 esb sap adapter link: http://wso2.org/premium/summer-school-2011-session4-enterprise-integration-with-sap-and-wso2-esb is info can found it? didn't find related in official documentation of wso2 esb... illustration showing how configure adapter in esb helpfull! thanks in advance, santiago. you can refer next documentation more info wso2 esb integration sap. http://docs.wso2.org/wiki/display/esb460/enterprise+integration+with+sap+and+wso2+esb this documentation added , hope able find info looking for. adapter sap wso2esb

Problems installing PHP 5.4.11 and MySQL 5.6.10 on CentOS 6.3 -

Problems installing PHP 5.4.11 and MySQL 5.6.10 on CentOS 6.3 - i'm attempting install php 5.4.11 , mysql 5.6.10 onto centos 6.3 box. i've installed php 5.4.11 via remi repository yum. i've installed mysql 5.6.10 using community server rpm's on mysql downloads page. they both work fine independently, when attempting install php-mysql remi repository, dependency of mysql-libs pulled in @ version 5.5.30, , going ahead install produces array of errors following: file /usr/share/mysql/czech/errmsg.sys install of mysql-libs-5.5.30-1.el6.remi.x86_64 conflicts file bundle mysql-server-5.6.10-1.el6.x86_64 at point, i'm out of depth regards getting working. can suggest need php installation working mysql? rpm --nodeps --force just override php mysql linux installation centos

asp.net mvc - iTextSharp creating file in memory resulting corrupted file -

asp.net mvc - iTextSharp creating file in memory resulting corrupted file - i trying create pdf file in mvc using itextsharp. have next simple used case. file getting created when open pdf getting error file corrupted unable open file. idea/help ? my controller code follows public filestreamresult getpdfmemory() { itextsharp.text.document doc = new itextsharp.text.document(); memorystream mem = new memorystream(); pdfwriter pdfwriter = pdfwriter.getinstance(doc, mem); //pdfwriter.closestream = false; doc.open(); doc.add(new paragraph("charts")); mem.position = 0; filestreamresult filestreamresult = new filestreamresult(mem, system.net.mime.mediatypenames.application.pdf) { filedownloadname = "chart_" + ".pdf" }; homecoming filestreamresult; } view : @html.actionlink("pdf memory"...

c# - EdmMetadata error only in Azure Compute Emulator -

c# - EdmMetadata error only in Azure Compute Emulator - i'm having problem getting application run within azure compute emulator. i'm using entity framework 6.0-pre2 , when application runs, next error: invalid object name dbo.edmmetadata the database created code first migrations. using same connection information, if runs within regular console application or asp.net mvc 4 website, works correctly. relevant app.config sections: <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> <connectionstrings> <add name="applicationservices" connectionstring="data source=localhost;initial catalog=database;integrated security=true" providername="system.data.sqlclient" /> </connectionstrings> <entityframework> ...