Posts

Showing posts from September, 2012

c# - Why is IQueryable lacking all the extension methods that IQueryable<T> has? -

same ienumerable vs ienumerable<t> . oversight? or there problem when don't have type specified makes implementing extensions .count() , .where() , etc impossible? from docs : the iqueryable interface intended implementation query providers. supposed implemented providers also implement iqueryable<t> . if provider not implement iqueryable<t> , standard query operators cannot used on provider's data source. ienumerable artifact of times when .net did not have generics ( don't mean deprecated, of course ). has lived on backward compatibility, after generics , hence ienumerable<t> introduced. iqueryable keeps consistency. basically, given there generics now, , given advantages, makes useful implement these extensions on generic interfaces. non-generic ones can converted generic ones using cast<t>

border - NextGEN Gallery - album showing too much space with Chrome -

i have problem nextgen gallery albums on site ( tornaia.com/bilder/ ) in chrome. borders around album-thumbnail big, have scroll way down next album. in firefox , ie shows here have schreenshot of how in chrome: ( http://tornaia.com/wp-content/uploads/2013/07/chrome.jpg ) and here how in firefox (how should looking): ( http://tornaia.com/wp-content/uploads/2013/07/firefox.jpg ) any idea why happens? or better: how fix it? thank you! never mind, solved myself :) i put .ngg-album { height:130px; } in style.css file. works ie, firefox , chrome. other browsers :

Mixing Javascript and jQuery? -

main question: possible use javascript conditional , use jquery code? here non-working example: <script> //<![cdata[ if (location.pathname == "/searchresults.asp" || location.pathname.indexof("-s/") != -1 || location.pathname.indexof("_s/") != -1) $('.colors_productname span').css("background-color", "#f7f7f7"); //]]> </script> the javascript conditional provided ecommerce platform (volusion) target category pages (the jquery doing). asked them if javascript code still work given urls dont include "/searchresults.asp" (one of them "/meats-s/3393.htm"), assured me should still work. secondary question: "location.pathname.indexof" lines do? jquery , javascript not separate languages. jquery library written in javascript, valid jquery statement valid javascript statement. q2: location.pathname path of url after domain name. e.g http://www.google.com/s/g

Java SimpleDateFormat timezone parsing -

i'm curious how java's simpledateformat decides when increment/decrement passed in time based on timezone it's set to. let's have date 06/04/2013. set timezone 1 far away me(i'm in gmt-5). let's use gmt+8. i call simpledateformat df = new simpledateformat( "m/d/yy" ); df.settimezone( timezone.gettimezone( "gmt+8" ) ); df.parse( enddate ) // returns 06/**03**/2013 //enddate string it returns 06/03/2013. why decrement it? edit: i'm asking reference point java uses knock date 6/3 if set gmt+8. there's logic says hey i'm not on current timezone let's change it. since i'm passing in string don't see be. i assume default if don't provide timezone in string default gmt. you're in gmt-5, , you're parsing string representing moment in gmt+8 time zone. so, date 06/04/2013 in fact 06/04/2013 00:00 gmt+8 . date @ gmt, have subtract 8 hours: 06/03/2013 16:00 gmt . , date @ gmt-5, have subtra

Converting "yield from" statement to Python 2.7 code -

i had code below in python 3.2 , wanted run in python 2.7. did convert (have put code of missing_elements in both versions) not sure if efficient way it. happens if there 2 yield from calls below in upper half , lower half in missing_element function? entries 2 halves (upper , lower) appended each other in 1 list parent recursion function yield from call , use both halves together? def missing_elements(l, start, end): # python 3.2 if end - start <= 1: if l[end] - l[start] > 1: yield range(l[start] + 1, l[end]) return index = start + (end - start) // 2 # lower half consecutive? consecutive_low = l[index] == l[start] + (index - start) if not consecutive_low: yield missing_elements(l, start, index) # upper part consecutive? consecutive_high = l[index] == l[end] - (end - index) if not consecutive_high: yield missing_elements(l, index, end) def main(): l = [10, 11, 13, 14, 15, 16, 17, 18, 20] print(list(missing_elements

How to pass along a string in HTML PHP -

#!/usr/local/bin/php <!doctype html> <html> <head> <script> function sendinfotochart() { document.getelementbyid("firstn").innerhtml=document.getelementbyid("firstname").innerhtml; } </script> </head> <body> <form action=""> first name: <input type="text" name="firstname" id="firstname"><br> <button onclick="sendinfotochart()"> submit </button> </form> <br><br> <table border="1" cellpadding="4" style="font-style:italic;"> <tr><td><p id="firstn"></p></td><td>middlename</td><td>last name</td></tr> </body> </html> i trying pass word type in text field , pass table when click button. cant figure out how pass along... ahead of time! you have use `value property of text box text , prev

php - APC cache shared between different directories? -

i'm working on php project in team. team members have own working directory on centos/apache server, this. /home/user1/public_html/project/xxxxx.php /home/user2/public_html/project/xxxxx.php and on. write , upload php files there , test our work accessing server browser. the problem apc caches php files without distinguishing directories. so, after accessing user1/project/xxxxx.php, cached, accessing user2/project/xxxxx.php produces result user1's php. i think because apc shares cache between different processes and/or paths. there way turn feature off? reason cannot turn off apc, need it. thank in advance. try clearing apc cache. can use php's built-in function apc_clear_cache( clear system cache. there's apc_clear_cache('user') . calling clear user cache. hope helps!

python json.loads / json.load truncates nested json objects? -

given following code: import json foo = '{"root":"cfb-score","children":{"gamecode":{"attribute":"global-id"},"gamestate":{"attribute":"status-id","attribute":"status","attribute":"quarter","attribute":"minutes","attribute":"seconds","attribute":"team-possession-id","attribute":"yards-from-goal","attribute":"down","attribute":"distance","attribute":"segment-number","attribute":"active-state"},"gametype":{"attribute":"type","attribute":"detail"},"stadium":{"attribute":"name","attribute":"city","attribute":"state"},"visiting-team:team-name":{"attribute":&

c# - How would you go about allowing a program to install on a specific computer only -

an example can lock steam account particular computer. my preferred language achieve c#. i use managementobjectsearcher unique info (like harddisk serial number) computer , put security in program works on machine.

how to check if a parameter (or variable) is numeric in windows batch file -

i need check if parameter passed windows batch file numeric or not. i found below answer using "findstr" command regular expression: https://superuser.com/questions/404338/check-for-only-numerical-input-in-batch-file i did try solution it's not working. (at least in windows 7 not working). test scenarios: aa #not valid number a1 #not valid number 1a #not valid number 11 #a valid number set "var="&for /f "delims=0123456789" %%i in ("%1") set var=%%i if defined var (echo %1 not numeric) else (echo %1 numeric) replace %1 %yourvarname% appropriate

Creating new table rows with data using php -

i have table populated php via text file. know how create new table each new data entry trying create new row instead of whole new table. how can create new row data instead of entire table? this have , want create new row variables in it. how can achive without creating whole new table each time. have tried couple of things no success. $tracreport = $tracreport . "<table width='100%' cellpadding='0' cellspacing='0' style='margin-top:15px; background-color:#000; color:#fff;'> <tr> <td style='padding: 3px 0px 3px 0px; font-size: .9em; text-align: center; color: #00ff00;'> tracking " . $tnumber[1] . " active storm cell</td> </tr> <tr> <td> <table width='100%' cellpadding='0' cellspacing='0'> <tr> <td>

javascript - Server requesting image every time -

i´m getting strange behaviour when deployed web app on windows server microsoft iis. creating image object img = new image() ; img.src = 'someimg.png' ; img.addeventlistener('load', incrementimagecount ) ; i´m doing image preloading via javascript , locally works perfect, when deploy on server browser request image every time it´s draw or redraw. have awful looks while it´s loading. in resources on web inspector see same images, multiple times. any ideas why may happening?

Selecting attributes in xml using xpath in powershell -

i trying use powershell , xpath select name attribute shown in below xml example. $xml_peoples= $file.selectnodes("//people") foreach ($person in $xml_peoples){ echo $person.attributes #echo $person.attributes.name } above code im running try , name, doesn't seem work. suggestions? <peoples> <person name='james'> <device> <id>james1</id> <ip>192.192.192.192</ip> </device> </person> </peoples> thanks in advance! i'm not sure $hub is, , started code middle it's not clear if set $file xmldocument object, think want: [system.xml.xmldocument]$file = new-object system.xml.xmldocument $file.load(<path xml file>) $xml_peoples= $file.selectnodes("/peoples/person") foreach ($person in $xml_peoples) { echo $person.name }

Facebook's FacebookApiException class's error codes? -

where can find list of error codes facebook's facebookapiexception class? found 2 such lists, both of outdated: https://developers.facebook.com/docs/reference/api/errors/ , http://www.fb-developers.info/tech/fb_dev/faq/general/gen_10.html from debugging own script, found out error #2500 "an active access token must used query information current user." , error #3501 "user associated article object on unique action type read." neither error codes in links posted above. this might you. login related error. https://code.google.com/p/facebook-actionscript-api/issues/detail?id=453

html - @Media with the "Min-Width" Property -

i'm trying new, @media , (min-width: 60em) . here have. problem i'm having in chrome , surprising. what's happening when zoom out (or start if have decent sized screen), "join" , "create" turn "join room" , "create room", respectively (which good). however, in chrome, when zoom in, must zoom in little past point changed "join room" , "create room" see regular "join" , "create" again. happens other way around, too. sorry if it's confusing, jsfiddle helps.

Randomly assigning labels to elements in a 2 dimensional array in Python -

let's have 4x4 symmetrical 2 dimensional array 0's on long diagonal this: [0 1 2 3] [1 0 3 4] [2 3 0 5] [3 4 5 0] i want randomly equally assign 2 labels every column, in order categorize these numbers groups. example, group 1 might contain numbers columns 1 , 3, , group 2 might contain rest of columns 2 , 4. using python, how randomly equally (so there equal amount of every label) assign n labels columns in mxm 2 dimensional symmetrical array? i'm not sure concept of labelling columns works here. these not columns elements same index point in multiple lists. why not create labellist , use access 'columns' want. can randomly order labellist import random labellist = [1, 2, 3, 4] random.shuffle(labellist) print labellist now have randomly ordered label list, , can use in order access '4x4 array' list of 4 lists in python terms. in each list within array 'column1' accessed referencing labellist[0] , on. if want work in terms of p

java - Android Expj4 check if expression is invalid -

i using library called expj4 on code http://www.objecthunter.net/exp4j/ , works fine, having little problem if use expression gives error evaluation. example if use: 2 + 3 * ( 5 + ((36) . in case added parenthesis , error , close app. what want know if there way check if expression can evaluated before give result, if expression wrong can handle it. here part of code. calculable calc = null; try { double varpi = math.pi; if (degrad == false) { calc = new expressionbuilder(txt) .withcustomfunction(cosdfunc) .withcustomfunction(tandfunc) .withcustomfunction(sindfunc) .withcustomfunction(funx) .withvariable("Ï€", varpi) .withvariable("x", varx).build(); } else { calc = new expressionbuilder(txt)

Bonjour Timeout -

when close lid of notebook , put sleep seems registered bonjour services notebook in network not disappear anymore on other machines. bonjour has timeout can set somehow? according bonjour's "frequently asked questions" page : when disconnect device network, remain visible? yes, while. eventually, dns record reaches time-to-live interval , disappears. app developer, if connect host using bonjour , connection fails, can ask bonjour reconfirm record. process described further in nsnetservices , cfnetservices programming guide.

jquery - Xml file contents not showing up in list on Wamp -

i have started using ajax methods after going w3schools , tried implement teachings in video saw. video is: http://www.bing.com/videos/search?q=ajax+read+xml+file+example&view=detail&mid=815376b884b91d80047d815376b884b91d80047d&first=0&form=nvpfvr i have done codings , put files in www page of wamp. open local host , try load data in xml file there no data loaded <ul> tag kept empty ajax load process. here code website named website.html <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="wrapper">

google app engine - GoogleAppEngine App for XML processing using JAVA -

i developing web application gets input user using gui , generates xml document out of it. after done, need upload app google app engine. have heard google app script use javascript create gui based applications. will google app engine support applications developed using google app script? kindly me out in that. thanks!! currently no. apps written using google apps script run independently of app engine although both of them run on google's servers

objective c - Get the Week Number in iOS SDK -

i want week number of year date.i tried code follow gives me wrong week number. my code week number: nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"yyyy-mm-dd"]; nsdate *date = [dateformatter datefromstring:@"2012-09-15"]; nscalendar *calendar = [nscalendar currentcalendar]; nslog(@"week: %i", [[calendar components: nsweekofyearcalendarunit fromdate:date] weekofyear]); //display 38 instead of 37 } note: if try with [nsdate date] display correct. help me solve this.. thank you, objectivec: nscalendar *calendar = [nscalendar currentcalendar]; nsdatecomponents *datecomponent = [calendar components:(nsweekofyearcalendarunit | nsdaycalendarunit | nsmonthcalendarunit | nsyearcalendarunit) fromdate:[nsdate date]]; nslog(@"%@",datecomponent); swift: let calendar = nscalendar.currentcalendar() let datecomponent = calendar.components([.weekofyear, .day, .mo

Windows Phone 8 checking If the stackpanel is in the visible area -

it's simple question. have number of stackpanels inside of scrollview. want them raise event when there visible user(via scrolling). thanks in advance. check this page out. shows how determine if element in scrollviewers viewport. // position of visual inside scrollviewer generaltransform childtransform = containedobject.transformtoancestor(scrollviewerobj); rect rectangle = childtransform.transformbounds(new rect(new point(0,0),containedobject.rendersize)); //check if elements rect intersects of scrollviewer's rect result = rect.intersect(new rect(new point(0, 0), scrollviewerobj.rendersize),rectangle); //if result empty element not in view if (result == rect.empty) { //.... } else { //obj partially or visible //skip or bring obj in view. }

s4 - Override setClass and setMethod in a package R 3.0.1 -

i having problem override setclass , setmethod in package requirement: r 3.0.1, rtools please find below steps recreate problem: 1. create class , method setclass(class="aaa", representation( name="character", val="numeric" ) ) setmethod("*", signature(e1 = "numeric", e2 = "aaa"), definition=function (e1, e2) { e2@val = e2@val * e1 e2 } ) 2/ save file in c:\aaa.r 3/ build package > setwd("c:") > package.skeleton(name="aaa",code_files="c:\\aaa.r") > system("r cmd build aaa") > system("r cmd install --build aaa") 4/ testing > library(aaa) > x = new("aaa") > x@val = 100 > -1 * x object of class "aaa" slot "name": character(0) slot "val": [1] -100 slot "type": character(0) 5/ override clas

c++ - Default item showing in non-editable comboBox -

i have non/editable combobox in gui c++ application (visual studio 2012) , want select default item/value in box collection (all items/value). hope can me make possible? let's have filled disabled combobox this: lpctstr s[] = {_t("blue"), _t("red"), _t("yellow")}; ccombobox* pcombo = (ccombobox*)getdlgitem(idc_combo_color); if(pcombo) { for(int i=0; i<3; ++i) { pcombo->addstring(s[i]); } pcombo->setcursel(1); // <- sets default value. here "red" } as illustrated in code snippet, setting selected item (index based)

C++ / boost : declaring an encapsulated shared_array -

i started use smart pointers. if correct, smart pointers declared: shared_array<double> a(new double[n]); but how if encapsulated in class ? moment doing follow, seems super ugly: header file: class foo { public: foo(int size); shared_array<double> _a; }; source file foo::foo(int n){ shared_array<double> p (new double[n]); _a = p; } you can use constructor initialization list: foo::foo(int n) : _a(new double[n]) {} in case need set managed array in constructor's body, then foo::foo() { int n = somecalculation(); _a.reset(new double[n]); }

c# - Dynamically display welcome string in "Your logo here" -

what trying dynamically display welcome string of company name based on url area of "your logo here" in mvc 4 internet applcation. if in http://aaa.com wanna welcome aaa what have done replace <p class="site-title">@html.actionlink("your logo here", "index", "home")</p> to @html.partial("_company") and in _company view @html.renderaction( "company", "home") , in homecontroller use public actionresult hospitalinfo() { var url = geturlmethod(); return partialview("_company ", new { name = url }); } can please let me know if idea correct or not ? or can me improve method. currently, code not work @ all... if you're interested in string, don't need spin separate partial view own controller action. create helper function, manipulate url in there, , call function directly view. .cs: public static string getcustom

ios - Consecutive touches in memory for iPad -

i'm @ beginning of app wich have uinavigationcontroller several consecutive views. forward navigation ok, found next problem in backward navigation: when touch in button in 1 of views have work, app shows 'loding...' label, because take 5-10 seconds back. but, if 1 person touches 2 times de button (thinking first touch haven't work), once app has done 5-10 seconds work, app goes 2 views in navigationcontrolles: 1 first view , second touch in button of previos view. root view -------> view 1 ('back button 1') -------> view 2 ('back button 2')/n | | | | | ----------------------------------- | | 1 touch , 5-10 seconds work | | | ------------------------------------------------------------ 2 consecutive touches on same place (user haven't wait) how can avoid second touch eff

Model binding is not working when creating different type inputs dynamically with AngularJs ng-repeat -

please @ code @ plunker http://plnkr.co/edit/tzi0xm if input type fixed (all text or checkbox...), there's no problem, data binding working, if defined input type dynamically, second input binding doesn't work, please me. <ul> <li ng-repeat="prop in currentnode.props"> {{prop.name}}<input ng-model="prop.value" type="{{prop.type}}"></input> </li> </ul> ok here html <li ng-repeat="prop in currentnode.props"> {{prop.name}}<input ng-model="prop.value" checked="{{prop.value}}" type="{{prop.type}}"></input> </li> and controller code var app = angular.module('plunker', []); app.controller('mainctrl', function($scope) { $scope.currentnode = {name:'cube', props:[ {name:'displayname',value:'new cube',type:'text'

scala - MongoDB cross-collection query with casbah -

i have 2 collections follwoing, customers: {id: 1, name: "foo"} {id: 2, name: "bar"} {id: 3, name: "baz"} flags: {cid: 1} {cid: 3} then retrieving customers flag on db.customers.find({id: {$in: db.flags.distinct("cid", {})}}) on shell works, can't same using casbah, since casbah not seem support querying function call or local variable. of course can in casbah - remember db.flags.distinct returns iterable should converted implicitly list use in $in . heres test example you: import com.mongodb.casbah.imports._ val db = mongoclient()("casbahtest") val customers = db("customers") val flags = db("flags") customers.drop() flags.drop() // add customers customers += mongodbobject("_id" -> 1, "name" -> "foo") customers += mongodbobject("_id" -> 2, "name" -> "bar") customers += mongodbobject("_id" ->

numpy - Kurtosis,Skewness of a bar graph? - Python -

Image
what efficient method determining skew/kurtosis of bar graph in python? considering bar graphs not binned (unlike histograms) question not make lot of sense trying determine symmetry of graph's height vs distance (rather frequency vs bins). in other words, given value of heights(y) measured along distance(x) i.e. y = [6.18, 10.23, 33.15, 55.25, 84.19, 91.09, 106.6, 105.63, 114.26, 134.24, 137.44, 144.61, 143.14, 150.73, 156.44, 155.71, 145.88, 120.77, 99.81, 85.81, 55.81, 49.81, 37.81, 25.81, 5.81] x = [0.03, 0.08, 0.14, 0.2, 0.25, 0.31, 0.36, 0.42, 0.48, 0.53, 0.59, 0.64, 0.7, 0.76, 0.81, 0.87, 0.92, 0.98, 1.04, 1.09, 1.15, 1.2, 1.26, 1.32, 1.37] what symmetry of height(y) distribution (skewness) , peakness (kurtosis) measured on distance(x)? skewness/kurtosis appropriate measurements determining normal distribution of real values? or scipy/numpy offer similar type of measurement? i can achieve skew/kurtosis estimate of height(y) frequency values binned along distance(

java - Delimited string between quotes? -

i have text file, , need read out double quoted strings. trying split() method, didn't want. example: "000abcd",000,hu,4614.850n,02005.483e,80.0m,5,160,1185.0m,,005,4619.650n,01958.400e,87.0m,1... in example, need string 000abcd . ideas? try this string str="\"000abcd\",000,hu,4614.850n,02005.483e,80.0m,5,160,1185.0m,,005,4619.650n,01958.400e,87.0m,1"; pattern p = pattern.compile("\"(.*?)\""); matcher m = p.matcher(str); while (m.find()) { system.out.println(m.group(1)); }

android - animate list view divider -

scenario: need line between items in list view , want apply animation (like slide left). well, customized list view divider. wanted animate it. is there possible way? if not, suggest alternative. you better add divider row layout handle it. display each row in listview then, use ontouchlistner on dividerobject (linearlayout) initialize gesture class : _dividerrow.setontouchlistener(new mygesturelistener() ); class mygesturelistener implements ontouchlistener { private pointf _init; @override public boolean ontouch(view v, motionevent event) { switch(event.getaction()) { case motionevent.action_down : _init = new pointf(event.getrawx(), event.getrawy()); if(!(v == null)) { _velocitytracker = velocitytracker.obtain(); _velocitytracker.addmovement(event); } break; case moti

c++ - Having trouble creating a class based implementation of OpenCV's mouseCallback function -

as title suggest, i'm having trouble implementing opencv's mousecallback function in class based c++ structure. allow me explain. have defined class called briskmatching in have created member function named mousecallback correct parameters opencv requires (please see code snippet below). **briskmatching.h** class briskmatching { public: briskmatching(); ~briskmatching(); public: void mousecallback(int event, int x, int y, int flags, void *param); }; this fine, problem arises when try set function designated mouse callback function through opencv's cv::setmousecallback function. in main function, create instance of briskmatching class called briskmatcher when comes time set mouse callback attempt so... cv::setmousecallback("matches", briskmatching::mousecallback, &matchesimg); unfortunately, throws error. error 3 error c3867: 'briskmatching::mousecallback': function call missing argument list; use '&briskmatch

python - safe for each variable in template =? autoescape off for whole template -

does use of |safe each variable in template application , each text equivalent {% autoestsape off %} whole template? if not when may exploitable? use filter tag apply filter whole part of template: https://docs.djangoproject.com/en/1.5/ref/templates/builtins/#filter

azure - Deliver Multiple assets in single publish Url -

we proposing use azure media services (wams) pre-recorded audio streaming. currently can create assets in media services audio data. suppose if need play multiple assets when deliver content how can same? currently each asset has separate publish url azure portal how can generate single publish url point multiple assets? also how play multiple assets in random sequence each different request? you cannot have single publish url multiple assets. each asset has associated publish urls. each publish url associated specific access policy. what want achieve called playlist. and, if playlists might supported products icecast or other, not supported in azure media services. you have maintain playlists within media application. , populate playlist items publish urls of media assets want in each playlist.

DataGrid column size (Compact Framework) C# -

Image
i'm new datagrids. my code: private void populategrid() { conn.open(); string query; query = "select company_id_no, company_name, last_update_datetime, username company"; oracledataadapter da = new oracledataadapter(query, conn); oracledataset ds = new oracledataset(); da.fill(ds); dgsku.datasource = ds.tables[0]; } this how looks on mobile device: i want automatically re-size columns 100%, like: i appreciate if can point me in right direction. thanks in advance! string query; query = "....sql..."; { conn.open(); using (oracledataadapter = new oracledataadapter(query, conn)) { datatable t = new datatable(); a.fill(t); dgsku.tablestyles.clear(); datagridtablestyle tablestyle = new datagridtablestyle(); tablestyle.mappingname = t.tab

asp.net - Adding form on page in ASP .Net -

im new in asp. i've created new c# simple web site. contain navigation menu , 2 pages. navigation menu like: <asp:menuitem navigateurl="~/default.aspx" text="home"/> and master page in form handle menu issues. i'm adding new web form contain <form runat="server"> and when try open page on server writes me: a page can have 1 server-side form tag. how should solve this? should use common form tag?!? by default asp.net pages have <form> tag wraps entire page. if add further <form> tag end nested forms isn't allowed. you can away dropping inner <form> tag.

dart - pub get error: Cannot create link...(OS Error: Incorrect function) -

i have error while trying packages angular dart codelab: --- 10:01:28 running pub ... --- pub failed, [1] resolving dependencies........................................ cannot create link, path = 'x:\dev\dart\ng-darrrt-codelab-master\packages\angular' (os error: incorrect function. , errno = 1) i tried remove in packages folder , try again. packages download correctly, " cannot create link " error persists... i'm on windows server 2008 , use darteditor 1.2.0 instead of downloading packages each project, pub downloads them cache directory , symbolic links packages directory. saves bandwidth because instead of downloading package every time needs symbolic link cache. if pub unable create symbolic link throws cannot create link error. on windows not possible symbolically link folder local drive network drive. can circumvent error moving file local drive , running pub get .

Mysql: How can I structure a table to hold usernames of various social networks? -

i want store social network usernames each of site's users. how can structure table hold names of social network sites along username given site? users id first_name last_name profiles fk_users_id country social_networks id name social_accounts ? fk_users_id ? i think should create new relation table.and create social_accounts keep relation table_id fk. socialnetworks_user_relation ---------------------------- relation_id user_id (fk_user_id) network_id(fk_socialnetwork_id) social_accounts ----------------- relation_id(fk_socialnetworks_user_relation) account_uname account_pass hope you.

coldfusion - SQL IN - Variable inside of table column? -

i know how check value of table column inside variable list, so: <cfquery datasource="test_sql" name="get"> select b c in ( <cfqueryparam cfsqltype="cf_sql_varchar" list="true" value="#d#"> ) </cfquery> but how reverse clause? i've tried hasn't worked: <cfquery datasource="test_sql" name="get"> select b <cfqueryparam cfsqltype="cf_sql_varchar" value="#c#"> in (d) </cfquery> this looks match within list stored in column d has value c. eg. c = 12345 column d - 4 rows 12344,12345,12346 --- match (list item 2) 12323,12327,12375 --- no match 12312,12341,12345 --- match (list item 3) 12128,12232,12345 --- match (list item 3) the record count should 3 there total of 3 matches value present within list. however, when run query not work. i'd assume many people have stumbled upon minor problem befo

sql - group by - counting rows and if not existing add row with 0 value -

Image
i know asked similar question, here start zero... without giving query tried don't influance you. if table: status pgid nvarchar5 nvarchar10 catid tp_id isactive null information technology null 1 1 1 hr null human recource null 1 2 1 fin null finance null 1 3 1 new 1 null 1354 2 10001 1 new 1 null 464 2 10002 1 new 1 null 13465 2 10003 1 active 1 null 79846 2 10004 1 deleted 1 null 132465 2 10005 1 new 2 null 79847 2 10006 1 new 2 null 341 2 10007 1 deleted 2 null 465 2 10008 1 deleted 2 null

Internal implementation of UIView's block-based animation methods -

ever since introduction in ios 4, have been wondering internal implementation of uiview 's block-based animation methods. in particular understand mystical features of objective c used there capture relevant layer state changes before , after execution of animation block. observing black-box implementation, gather needs capture before-state of layer properties modified in animation block, create relevant caanimations . guess not snapshot of whole view hierarchy, horribly inefficient. animation block opaque code blob during runtime, don't think can analyze directly. replace implementation of property setters on calayer kind of recoding versions? or support property change recoding baked-in somewhere deep inside calayers ? to generalize question little bit, possible create similar block-based api recording state changes using objective c dark magic, or rely on knowing , having access internals of objects being changed in block? it very elegant solution built a

c - Searchin in a stack -

this code searching part , it's not working. can give me little on this? i'm newbie on programming , suck @ pointers. thanks. typedef struct dictionary_entry{ int index; char character[100]; struct dictionary_entry *link; }dictionary_entry; typedef struct dictionary{ dictionary_entry *top; }dictionary; int check_in_dictionary(dictionary *dictionary, char string[100], char file_char[100]){ dictionary_entry *runner = dictionary->top; strcat(string, file_char); while(runner != null){ if((strcmp(string, runner->character)) == 0){ break; return runner->index; } } return -1; } here corrected version comments starting //// int check_in_dictionary(dictionary *dictionary, char string[100], char file_char[100]){ dictionary_entry *runner = dictionary->top; strcat(string, file_char); while(runner != null){ if((strcmp(string, runner->cha

jquery - Calling Jabber sdk for web through firefox add-on -

here scenario.... scenario : have developed mozilla add-on detects phone numbers on given web page , highlights number hyperlink. comes real question.... when user clicks on number, click event should call jabber sdk plugin initiate audio/video communication. problem : unable figure out how add-on can call plugin. message passing solution? if , need guidance figure out. hope question clear everyone.

plot - Make doted lines in r-statictic legend -

i´ve tried legend plot different lines. lines black have used lwd , lty separate them each other. looks great, want make legend explains line which. works fine lwd lines when i´m trying same lty lines error message: >error in segments(x1, y1, x2, y2, ...) : invalid line type: must length 2, 4, 6 or 8 the command i've used plotting legend is legend('topleft', legend= c("red light","blue light") , lwd=c("1","2")) this first 2 have tried command: legend('topleft', legend= c("green light","orange light") , lwd=c("1","2")) i'm not quite sure want, help: plot(0, 0) legend('topleft', legend= c("red light","blue light"), lwd=1:2, lty=1:2)

command line interface - Connecting to an sftp server with lftp in a passworless fashion? -

i'm running following script uses lftp: lftp -f " open sftp://myuser@sftp_server:443 lcd $ftp_folder mirror --no-empty-dirs --only-newer --verbose $ftp_folder $local_folder bye " now if i've allready passed public key server administrator if in command line sftp -p 443 myuser@sftp_server connected , sftp prompt. when pwd command tells me folder need sync has path "/0datos" , value of $ftp_folder. when execute script this: source: directory password: is there way connect without server asking me password (i don't have it) in order sync folder 0datos local folder of mine? just supply empty password in url: open sftp://myuser:@sftp_server:443 lftp asks password before connecting server, if server not require 1 lftp not send it.

javascript - jQuery adding custom password rule not working -

i new jquery , using jquery form validator validate form.. the problem , have validate password must contain at-least 1 digit.. i searched on google , found example in here link forum.jquery here snippet of html code <form name="f2" id="f2" method="post" action="hello"> <table> <tr> <th> password </th> <td> <input type="password" name="pwd" id="pwd" placeholder="enter password" class="text_box"> </td> </tr> <tr> <td> <button type="submit" class="submit-button">register</button> </td> </tr> </table> </form> //jquery script form validation <script> $(document).ready(function(){

c# - How to use Numlock keys in calculator -

i writing program of simple calculator. able make calculator, entering through mouse clicks. i wanted know how use numlock keys entering numbers. it can little tedious, assuming application wpf, here's overview of user input msdn. the important part window definition (the xaml) can keydown event handler assigned. if add it, when hit = , should given opportunity have method created. that, , can figure out key pressed , it. msdn example of looks this: private void onbuttonkeydown(object sender, keyeventargs e) { button source = e.source button; if (source != null) { if (e.key == key.left) { source.background = brushes.lemonchiffon; } else { source.background = brushes.aliceblue; } } } i don't recommend color thing, myself, can connect logic use buttons, instead, too, if wanted.

python - How to convert multiple newlines in mako template to one newline? -

i using mako template python , trying generate text file using list python script. part of code shown below causing problem. % compname in tpdob.scalar_modi: ${compname[0]} ${compname[1]} ${compname[2]} ${compname[3]} % endfor i using code , output horrible. here, have many lists in scalar_modi , printing them 1 one (each list has 4 values). problem is, there many newlines gets printed making output text file ugly. searched on net, unable find required solution. can please me out this? comments on output: with ${compname[0]} ${compname[1]} ${compname[2]} ${compname[3]} , getting: 1 42 gzb dli 14 23 tpty sre 32 55 puri ald when using ${compname[0]} ${compname[1]} ${compname[2]} ${compname[3]} \ , gives : 11 42 gzb dli14 23 tpty sre32 55 puri ald , want like: 11 42 gzb dli 14 23 tpty sre 32 55 puri ald and when using if-else conditions, getting more 2 newlines . can please me this. unable find solution in documentation :( i had same problem,

getting POST datas in java Spring Rest Server from $.fileDownload -

i've wrote application download file using jquery file download v1.2.0 plugin. in jquery file download v1.2.0 have option send datas post post request data , query string $.filedownload('/getafoo?a=b', { httpmethod : "post", data: { foo : "bar"}}) can please tell me how receive post datas on server side, i'm using java spring rest server my code given below script var json ="[[\"name\",\"place\",\"phone\"]," + "[\"aaa\",\"hhh\",\"123\"]," + "[\"bbb\",\"\",\"254\"]," + "[\"ccc\",\"'#?\",\"\"]]"; $.filedownload(url,{ httpmethod : "post", data: { excelcontent : json}}).done(function(e, response) { }).fail(function(e, response) { }); java spring rest @requestmapping(value = "filedownload", method = requestmethod.get, produces = app_

cordova - PhoneGap upload Image to server on form submit -

i facing problem here in phonegap image uploaded server once u select picture.i don't want upload image before submitting form. image uploaded automatically server don't want.i want upload image form, form contains many more fields required send along image. possible ways submit form? <!doctype html > <html> <head> <title>registration form</title> <script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script> <script type="text/javascript" charset="utf-8"> // wait phonegap load document.addeventlistener("deviceready", ondeviceready, false); // phonegap ready function ondeviceready() { // cool things here... } function getimage() { // retrieve image file location specified source navigator.camera.getpicture(uploadphoto, function(message) { alert('get picture failed'); },{ quality: 50, destinationt

android - mupdf: how to open pdf file with openBuffer method? -

unfortunatelly, haven't found documentation on point, maybe wrong. i use mupdf sample android , have modified source code of mupdfactivity way: public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); malertbuilder = new alertdialog.builder(this); if (core == null) { core = (mupdfcore)getlastnonconfigurationinstance(); if (savedinstancestate != null && savedinstancestate.containskey("filename")) { mfilename = savedinstancestate.getstring("filename"); } } if (core == null) { intent intent = getintent(); byte buffer[] = null; if (intent.action_view.equals(intent.getaction())) { uri uri = intent.getdata(); try { inputstream inputstream = new fileinputstream(new file(uri.tostring())); int len = inputstream.available();