Posts

Showing posts from April, 2011

javascript - Debugging jasmine 2.0 tests with resharper -

i want debug javascript unit test inside jasmine 2.0 within resharper 8, i.e. want test pause can open chrome debugger @ variables etc. there stackoverflow answer jasmine 1.3 given here , not work in jasmine 2.0. anyone got suggestion? i have found 1 way stop jasmine 2.0 unit test returning resharper. whether best way don't know, works. include line below in test don't want complete. resharperreporter.prototype.jasminedone = function () { }; you need press stop on resharper unit test page stop test. i should doing doesn't stop jasmine test finishing, don't have access locals inside test. have voted this issue on resharper web site there has better solution. if have problem suggest vote too.

android - ArrayAdapter need to be clear even i am creating a new one -

hello i'm having problems understanding how arrayadapter works. code working dont know how.( http://amy-mac.com/images/2013/code_meme.jpg ) i have activity, inside have 2 private classes.: public class mainactivity extends activity { ... private void someprivatemethod(){ autocompletetextview.setadapter(new arrayadapter<string>(this, android.r.layout.simple_spinner_dropdown_item, new arraylist<string>(arrays.aslist("")))); autocompletetextview.addtextchangedlistener(new mytextwatcher()); } ... private class mytextwatcher implements textwatcher { ... } private class searchaddresstask extends asynctask<string, void, string[]> { ... } } now inside textwatcher class call search address task: @override public void aftertextchanged(editable s) { new searchaddresstask().execute(s.tostring()); } so far good. in searchaddresstask stuff on doinbackground() returns right

applescript - How can I delete an existing skype contact? -

how can remove contact on skype using applescript? if possible there way without skype asking permission controlled? sorry don't think possible. skype has removed ability scriptable. https://discussions.apple.com/message/23030718#23030718

Azure worker role accessing web role configuration file -

i have cloud service webrole , workerrole. within webrole, have 9 different deployment configurations, each own connection strings. these connection strings encrypted. for ease of use, have created function in webrole return connection string web.config. within workerrole, have added reference webrole dll. can call function above connection string deployment configuration need. this worked month. stopped working, , returning development connection string. don't understand why work while, , stop. i assume configurations in .cscfg file? if yes, deployed .cscfg file development connection strings in workerrole's configuration section. can see configuration values in management portal verify this.

Pull timer value from a webpage using xPath and C# -

i trying pull timer values off of websites using xpath in htmlagilitypack. however, when using xpath, null reference exceptions because particular node not exist when grabbing it. test why was, used doc.save check nodes myself, , found nodes not exist. understanding, htmlagilitypack should download webpage how see it, data in there well. however, of data in fact missing. how supposed grab timer values, or event title either of following websites: http://dulfy.net/2014/04/23/event-timer/ http://guildwarstemple.com/dragontimer/eventsb.php?serverkey=108&langkey=1 my current code pull title of event first timebox guildwarstemple is: public void updateeventdata() { //string url = "http://dulfy.net/2014/04/23/event-timer/"; string url = "http://guildwarstemple.com/dragontimer/eventsb.php?serverkey=108&langkey=1"; htmlweb web = new htmlweb(); htmldocument doc = web.load(url); doc.save("c:/doc.html"); title = doc.docu

authorization - Permissions design pattern that allows date-based access -

i looking @ ways implement authorization (not authentication) scheme in app. there 2 roles in system: , b, there may more. user's have 1 role. basically, have set 2 database tables. 1 role-based permissions on model, , other specific user-based permissions. thinking way, users can have set of default permissions based on role-based permissions, can have specific permissions granted/revoked. so example: table: user_permissions columns: user_id: [int] action: [string] allowed: [boolean] model_id: [int] model_type: [string] table: role_permissions columns: role: [int] action: [string] model_type: [string] in user_permissions table, allowed field specifies whether action allowed or not, permissions can revoked if value 0. in table, have definitions each action: table: model_actions columns: action: [string] bitvalue: [int] model_type: [string] i when check permissions on model, example ['create', 'de

admob - Could not initialize AdView: Required XML attribute "adUnitId" missing -

i trying add advertise app . while trying run giving error: could not initialize adview: required xml attribute "adunitid" missing. although have given admob site generated adunitid . my xml file following: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <tablelayout android:id="@+id/tablelayout1" android:layout_width="wrap_c

How can I find the index of an item in Swift? -

this question has answer here: how find index of list item in swift? 13 answers is there method called indexof or similar? var array = ["jason", "charles", "david"] indexof(array, "jason") // should return 0 edit: of swift 3.0, should use .index(where:) method instead , follow change in swift 2.0 edit below. edit: of swift 2.0, should use indexof method instead. returns nil or first index of argument. if let = array.indexof("jason") { print("jason @ index \(i)") } else { print("jason isn't in array") } use find function. returns either nil (if value isn't found) or first index of value in array. if let = find(array, "jason") { println("jason @ index \(i)") } else { println("jason isn't in array") }

ruby on rails - Multiple update forms for one model -

i want have multiple forms on 1 page. let's make example understand want: i have page admins, let's it's admins#show page. admin has change name on 1 form on page , on form age. know create 1 form want have multiple forms (because example). admins#show page looks this: <%= form_for @admin |a| %> <%= a.label :name %> <%= a.text_field :name %> <%= a.submit "submit name change" %> <% end %> <%= form_for @admin |e| %> <%= e.label :age %> <%= e.number_field :age %> <%= e.submit "submit age change" %> <% end %> but in controller, don't know how works , here problem. think have this, how divide form inputs in update method?: def edit @admin = admin.find(params[:id]) end def update @admin= admin.find(params[:id]) if @admin.update_attributes(:name=> admin_params1[:name]) redirect_to @admin else render 'edit'

CSS link colour different display to css code? -

Image
i'm doing design css zen garden, partly refresh css skill , knowledge , have found problem link colours in css code. as shown in annotated image, a:link color (#b7a5df) seems create x2 link colours! eg links #b7a5df colour others reason #d7cddc! the css code standard in csszengarden default.css file eg: a:link { font-weight: bold; text-decoration: none; color: #b7a5df; } a:visited { font-weight: bold; text-decoration: none; color: #d4cddc; } a:hover, a:focus, a:active { text-decoration: underline; color: #9685ba; } at moment cannot see why should , grateful ideas of might causing can find , fix link color same! caused simple i've overlooked frustrating , i'd appreciate second opinion now-thanks! edit...the above problem firefox. links display same colour in ie , chrome. below image ie: looks visited links. "a:visited" colour of links pages have been on. "a:link" colour of unvisited links you use "a

python - Pyglet vertex_list_indexed exception -

i have class render coordinate axis in pyglet: class axis(object): def __init__(self, position=(0.0, 0.0, 0.0), x_color=(1.0, 0.0, 0.0), y_color=(0.0, 1.0, 0.0), z_color=(0.0, 0.0, 1.0), length=1.0): self.position = list(position) self.x_color = map(float, list(x_color)) self.y_color = map(float, list(y_color)) self.z_color = map(float, list(z_color)) self.length = float(length) lines = ( 0, 1, 0, 2, 0, 3 ) vertices = ( self.position[0], self.position[1], self.position[2], self.length, 0.0, 0.0, 0.0, self.length, 0.0, 0.0, 0.0, self.length ) colors = ( self.x_color[0], self.x_color[1], self.x_color[2], self.y_color[0], self.y_color[1], self.y_color[2], self.z_color[0], self.z_color[1], self

android - Rendering problems missing styles after every update -

Image
i "rendering problems. missing styles. correct theme chosen layout?" , gradle resolving without end after every android studio update, making entire code non runnable. solution recreate project. there solution this? really, annoying. try invalidate caches , restart. in android studio go file menu , choose invalidate caches / restart , confirm invalidate , restart . an image showing appropriate menu item in android studio:

html - bottom padding on scrolling fixed-height div is ignored in firefox -

Image
i have div fixed height , padding attribute. set overflow auto let browser add scrollbars. want able scroll down until whole bottom padding visible, gets truncated entirely. here's fiddle css: #content { padding: 40px; width: 250px; background-color: #ccc; overflow: auto; } html: <div id="content"> lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. @ vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet. lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. @ vero eos et accusam et justo duo dolores et ea rebum. stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet. </div> edit: found out misbehaves on firefox

How to insert a sublayer in swift? -

i creating view , adding gradient layer it. i have this: import uikit import quartzcore let rect : cgrect = cgrectmake(0,0,320,100) var vista : uiview = init(frame: rect) let gradient : cagradientlayer = cagradientlayer() gradient.frame = vista.bounds let cor1 = uicolor.blackcolor().cgcolor let cor2 = uicolor.whitecolor().cgcolor let arraycolors = [cor1, cor2] gradient.colors = arraycolors now have this [view.layer insertsublayer:gradient atindex:0]; how do in swift? you can use following snippet view.layer.insertsublayer(yourlayer, atindex: yourindex)

hadoop - What is Hue all about? -

Image
i new big data. want know hue. know hue is web interface manage hadoop ecosystem. please let me know if can install in on pc (ubuntu precise). running apache hadoop 1.2.1 in pseudo distributed mode pig , hive thanks in advance hue web interface analyzing data apache hadoop. can install in pc hadoop version. hue suite of applications provide web-based access cdh components , platform building custom applications. the following figure illustrates how hue works. hue server "container" web application sits in between cdh installation , browser. hosts hue applications , communicates various servers interface cdh components. here have explanations hue , downloads: http://gethue.com/

ios - Queue of 2 background processes -

i need create queue of 2 background processes work synchronously. i trying code not it. mistake? dispatch_sync(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ //block1 dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{ //block2 }); }); if understand question, need create serial queue if want blocks run synchronously: dispatch_queue_t queue = dispatch_queue_create("queue-name", dispatch_queue_serial); dispatch_async(queue, ^{ // first block }); dispatch_async(queue, ^{ // second block }); both these blocks run on unnamed background thread, run synchronously. first block finish executing before second block begins. you don't want use background priority. queue run backed default priority global queue, want.

sql - How to insert into a table from another table when both have two primary keys in Oracle? -

i have identical table of applies on 2 databases. have link in 1 of databases one. have filled of data, except applies table (so there no error insertion or connection): the command run is: create synonym app applies@"db.data-pc10"; insert applies select * app app.a# in ( select a# applicant) , app.p# in ( select p# position); the error receive is: error @ line 1: ora-01502: index 'bkg988.applicant_pkey' or partition of such index in unusable state i tried disable pk temporary on both sides: alter table applies disable constraint applies_pkey; table altered. but still same error. appreciate if give me solution: /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ create table applies( a# number(6) not null, /* applicant number */ p# number(8) not null, /* position number */ appdate date not null, /* application date */ constraint applies_pkey primary key ( a#, p# ), co

c# - Kentico - Using punctuation with AuthenticateUser -

Image
we using version 7.0 of kentico api authenticate users our system. the following code used gain user details database , authenticate users. userinfo objuserinfo = authenticationhelper.authenticateuser(username.tolower(), password.tolower(), cmscontext.currentsitename); this has been working correctly, having issues usernames , passwords contain of following characters. " ! @ ' / \ > < * - is there settings need aware of (web.config or otherwise) stop api accessing account username or password contained special characters? looks there according documentation. check web.config key: <add key="cmsuservalidationregex" value="([a-za-z0-9-]+)" /> sets custom regular expression used user name validation (used when new accounts created or when existing usernames modified). the default value "^[a-za-z0-9_\-\.@]+$". if cmsensuresafeusernames key set false, following regular expression used default: "^[a-za

jquery - Customize Countdown JS [Close] -

i follow countdown library http://keith-wood.name/countdown.html , use code display timer var def = 2 * 60 * 1000; var = new date(); var timer = new date(now.gettime() + def); $('#countdown').countdown({until: timer}); and output 3minutes need output 180 countdown 179, 178, 177.. 0. how customize it? solved add : format: 's' to add in input text : layout:'<input type="text" value="{sn}">' thanks rahul gupta , jeek online here working jsfiddle js code: var = new date(); now.setseconds(now.getseconds() + 180); $('#countdown').countdown({until: now, format: 's'});

c# - Read date from file name -

what need convert string obtain reading file's name, in form of yyyymmdd.log , transform in object of type 'datetime'. the command use create file is: string filepath = path.combine(filedailyenergysavinguppername, string.concat(date.tostring("yyyymmdd"), ".log")); how convert string date? edit: looking online found this: datetime mydate = datetime.parseexact(mystring, "yyyymmdd",null); is correct? have @ datetime.tryparseexact e.g. datetime datevalue; bool parsed = datetime.tryparseexact(datetime, "yyyymmdd", cultureinfo.invariantculture, datetimestyles.none, out datevalue);

php - is it possible to array push value into existing array value with sum? -

is possible array push value existing array value sum? $nvarr = array("1"=> 35, "2"=> 1, "3"=> 2, "8"=> 56, "9"=> 78); i have add 1 more array value existing array $nvarr1 = array("1"=> 35, "2"=> 1); and want following out put $nvarr = array("1"=> 70, "2"=> 2, "3"=> 2, "8"=> 56, "9"=> 78); you can foreach foreach($nvarr1 $key => $val){ (array_key_exists($key, $invarr))? $invarr[$key] += $nvarr1[$key] : $invarr[$key] = $nvarr1[$key] }

swing - Java Value must Be Between 0 and 100 -

i have code: package com.cjburkey.downloads.wie_ein_chef; import java.awt.flowlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.beans.propertychangeevent; import java.beans.propertychangelistener; import java.io.bufferedoutputstream; import java.io.file; import java.net.httpurlconnection; import java.net.url; import java.util.concurrent.executionexception; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.joptionpane; import javax.swing.jprogressbar; import javax.swing.swingworker; import net.lingala.zip4j.core.zipfile; import net.lingala.zip4j.exception.zipexception; public class download { final static jframe frm = new jframe(); final static jlabel status = new jlabel("downloading..."); final static jbutton cancel = new jbutton("cancel"); static file filedown = null; static string dire = null; public download(string site, file file, string dir) { filedown

android - Gridview horizontal with vertical and horizontal views -

Image
i'm totally new in android , i'm trying create new app special gridview because it's horizontal gridview vertical rows , horizontal rows, similar this: the orange row continue indefinitely blue rows loaded separately. i'm totally lost, idea can start?

android - NFC Tag is null on onNewIntent() -

i have been developing app uses nfc tags magic. all has been until when changed code thats not related of nfc code has been working. when launch application via nfc tap, works , recieve future nfctag's in onnewintent() tap whilst application running. when launch application via icon , attempt tap while application running, onnewintent() method called, when try nfctag intent returns null. am correct in thinking though null, have set foregrounddispatch correctly since onnewintent() called? heres code... protected void onresume() { if(this.mnfcadapter==null) { mnfcadapter = nfcadapter.getdefaultadapter(this); } pendingintent pendingintent = pendingintent.getactivity(this, 0, new intent(this, getclass()).addflags(intent.flag_activity_single_top), 0); intentfilter nfcfilter = new intentfilter(nfcadapter.action_ndef_discovered); try { nfcfilter.adddatatype("application/application.myorg.myapp"); } catch (malformedmimetypee

addresses of labels in assembly 80x86 -

i have general question on labels in assembly. if have code: func_start: ; code here func_end: which label has higher address? if it's written that, in traditional assembly code, func_end have higher address. rule, program flows lower-to-higher address. program counter increases every instruction executed, moving forward through program memory.

docusignapi - Docusign - No HTTP response when document is declined -

i've been tasked continuing support/update docusign api setup made predecessor, , i've been having trouble http responses docusign related documents being declined. as far understand, sent signed copies of docusign document whenever 1 or more of signers complete portion. however, have yet receive 1 whenever decline envelope. is there missing? (my apologies comment above -- misunderstood original question.) if you're looking docusign automatically send (i.e., application) notification via http post whenever envelope declined, can accomplish in either 1 of 2 ways: by configuring docusign connect (at account level). see dev center ( https://www.docusign.com/developer-center/explore/connect ) , connect service guide ( http://764be237d39fdfa0985f-37a6c1f0731907180d9764651d02bea9.r5.cf2.rackcdn.com/docusign_connect_service_guide.pdf ) more info. or by specifying eventnotification (at envelope level) part of create envelope api request each envelo

javascript - Rotate icon and toggle content onclick at the same time -

i'm trying rotate icon when click on link next icon. idea when click on link, icon rotate , content slide down. have manage make content slide down can't icon rotate in same script. this script: <script> $(function(){ $(".change_delivery_address").click(function(){ $(".spm").slidetoggle(); }); }); this de html: <div class="change_delivery_address"><h6>choose delivery address<img src="images/layout- img/menu-icons/arrow_carrot-right.png"></h6> </div> the css: .change_delivery_address h6{ cursor: pointer; color: #3274f4; margin-top: 20px; padding-top: 5px; padding-left: 20px; } .change_delivery_address h6:active{ background: none; } .spm { display: none; } hope can me out thanks. it looks though problem haven't included rotation in click function. include jqueryrotate , small library allows rotation, adding <script type="text/java

architecture - Which system works is the best? -

i have application runs under 16 weblogic instances, distributed on 4 servers. on top of that, have 2 apache servers, communicating application servers. and on top of that, have load balancing system (css card, going replaced type of card - ace card-). this works fine. but company rid of 2 apache servers, , integrate 1 iis instance communicate 1 weblogic instance. so basically, i'll have: 16 iis instances, speaking 16 weblogic instances, 1-1 relationship. personally, i'm skeptical architecture, because: what happen if weblogic instance goes down ? mean, iis instance still continues receive requests load balancing system. know new load balancing system can first send request see if application responding, , if so, let request go further. but, can imagine taking quite lot of time, , it's not performance. moreover, if application responding (meaning weblogic , running), time, iis not, load balancing system send request iis instance down. users have wait

mysql - MariaDB Galera Cluster set up problems -

i trying mariadb cluster , running not working out me. right using mariadb galera 5.5.36 on 64 bit red hat es6 machine. installed mariadb through repo here: [mariadb] name = mariadb baseurl = http://yum.mariadb.org/5.5-galera/rhel6-amd64/ gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb gpgcheck=1 in server.conf have following in server 1: [mariadb] log_error=/var/log/mariadb.log query_cache_size=0 query_cache_type=0 binlog_format=row default_storage_engine=innodb innodb_autoinc_lock_mode=2 wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_cluster_address=gcomm://192.168.211.133 wsrep_cluster_name='cluster' wsrep_node_address='192.168.211.132' wsrep_node_name='cluster1' wsrep_sst_method=rsync and on server 2 have [mariadb] log_error=/var/log/mariadb.log query_cache_size=0 query_cache_type=0 binlog_format=row default_storage_engine=innodb innodb_autoinc_lock_mode=2 wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_cluster_address=gcomm

c - Reading EEPROM AVR -

Image
i have problem when receive data eeprom. first made following code : #include <avr/io.h> #include <avr/eeprom.h> char name[5] eemem = "a001"; char unit[2] eemem = "c"; uint16_t cyclicity eemem = 2000; int main(void) { while(1) { //todo:: please write application code } } and have extracted .hex , .eep files. wrote files avrdude. first write wrong because put .hex file on eerpom:w , destroy bytes, not important. after write using correct command , see part of data in next print screen. i saving number , c , a001 . see in first row there ..c.a001. 9 bytes wrote. now in program! try this: char eemem name[5] ; char eemem unit[2] ; uint16_t eemem cyclicity; void _vreadeeprom(char *au8name,char *au8unit,uint16_t *u16cyclicity) { eeprom_read_block((void *)&au8name,(const void *)name,5); eeprom_read_block((void *)&au8unit,(const void *)unit,2); *u16cyclicity = eeprom_read_word

jquery - How to access the next element and check if it has a particular class -

i need call function based on whether second following td element has class. here html <tr id="939"> <td data-id="939">test2</td> <td class="hold" data-id="939"></td> </tr> <tr id="938"> <td data-id="938">test1</td> <td class="someotherclass" data-id="938"></td> </tr> here jquery function $('body').on('click', '#article td:first-child', function(e){ // need check next td hold class if($(this).next().hasclass(".hold")){ // call function } }); how do this? i've tried using next , closest yields nothing. edit: i've made fiddle: http://jsfiddle.net/ndxbb/ $(this) not refer td class getjson . try this: $('body').on('click', '#article td:first-child', function(e){ $nextobj = $(this).next(); //your getjson funct

windows - RuntimeWarning while using lambda function (Win8 computer) -

i installed python(x,y)-2.7.5.0 run python programs on win8 laptop. programs run on linux, when use python(x,y) error message: d:\python27\lib\site-packages\scipy\optimize\minpack.py:402: runtimewarning: number of calls function has reached maxfev = 2800. warnings.warn(errors[info][0], runtimewarning) the error occurs during harmonic analysis @ "func= lambda..." part: y = n.ravel(zon[:,z,k,:]) print k func = lambda p,s,c,y: fitfunc(p,s,c) - y # distance target function print k p1, success = optimize.leastsq(func, p0[:], args=(s,c,y)) i looked up, maxfev defined, guess, it´s not idea change it. question is, whether error caused bug of python(x,y) or windows 8 system. how can search after answer? does else use python(x,y)-2.7.5.0 win8 computer? as suggested padraic cunningham ( python 64 package windows ), installed anaconda 64bit windows. there no problems anymore. think, 1 problem might have been 32bit version

ios - cocos2d move an object along a path with constant velocity -

i looking method move object along path constant velocity,like car racing on track. tried ccactionbezier , ccactioncardinalspline, can't keep velocity. ccactions on time have durations, because of have scale duration distance want go. option roll own using -(void)update:(cctime)delta method.

How do I restrict column filtering in Kendo UI grid to only allow the 'OR' operator? -

in kendo ui grid have option set many attributes filter ui on each column. have column in grid defined follows: { field: 'task', title: 'task', width: 110, filterable: { ui: tasksfilter, operators: { string: { eq: "is equal to" } } } } i want user have 2 options joined dropdown can select "and" or "or" "or" valid option. there parameter in column definition allow me restrict user "or"?

cross compiling - Install iw for AR Drone -

i involved in project using parrot ar drone 1.0 attach usb dongle act mesh node. need install software called iw , improvement of iwconfig, i following instructions of project hence need cross compile arm processor struggling because of dependencies , overall inexperience in cross compiling. made bold move of transfer raspberry pi has arm, seems not work. does managed similar? thanks, appreciated jordi

Concise way to handle the Calendar object in Java -

some of used methods in calendar object return void , not chainable, such add(). more so, class appears mutable if add, example, day calendar object, original calendar object modified new date. i have written this: calendar currenttime = calendar.getinstance(timezone.gettimezone("utc")); // report.time() returns calendar instance if(report.time().after(currenttime.gettime().add(calendar.date, 1)) || currenttime.after( report.time().add(calendar.month, 5) )){ validtime=false; } this not compile because add() methods being used in parameters of after() return void , after() expecting calendar instance, not void. the other solution can think of ugly , bloated: calendar currenttime = calendar.getinstance(timezone.gettimezone("utc")) calendar nextday = calendar.getinstance(timezone.gettimezone("utc")); nextday.add(calendar.date, 1)) calendar nextmonths = calendar.getinstance(timezone.gettimezone("utc")); nextmonths.add(calendar.month

Publish to Azure from Vs2013 with 'Execute Code First Migrations' checked overwrote remote database -

while regular publish azure webdeploy, had checked execute code first migrations, did before. time use connection string @ runtime, checked, , published without noticing it. result remote azure db wiped , instead seeded looks default database aspnetmemembership tables , _migrations table has migrations related identity tables. the production data w db structures gone , did not yet setup backup on azure, doing now. is there way restore database sort of auto backup on azure, have web version w 1gb size selected, not see options suggests web version not have daily backup, web version discountinued of april, still have it. http://msdn.microsoft.com/en-us/library/jj650016.aspx and questions, understand happened? seems extremly dangerous easy wipe out whole database , vs shows no warning nor publishing azure notifies of anything. there can done prevent dumb yet costly erros ? tia

c - can't read bmp file perfectly -

i newbie in c ,i write c code reading bmp file of 2448x280 pixels having 32 bit depth , writing new bmp file. read pixels 1 one. reading header , problem after completing read , write operation on pixels, current position original image is= 2741814, right according me result image have position = 2903490. so, please tell me mistake. here code:- #include<stdio.h> #include<conio.h> void main(void) { long int length; int count,r,c,p; file *image; file *result; char read_pixels; image=fopen("image.bmp","rb"); result=fopen("result.bmp","w+"); for(count=0;count<54;count++) { fread(&read_pixels,1,sizeof(read_pixels),image); fprintf(result,"%c",read_pixels); } for(c=0;c<280;c++) { for(r=0;r<2448;r++) { for(p=0;p<4;p++) { fread(&read_pixels,1,sizeof(read_pixels),image); fprint

jquery - Add and remove class in navigation -

i building navigation list open , close. work hidden list open , close, can not change fa class fa-plus fa-minus when child list opened. <nav> <ul> <li class="test"><a href="#">menu 1 <i class="fa fa-plus"></i></a> <ul> <li><a href="#11">sub menu 1</a></li> <li><a href="#12">sub menu 2</a></li> <li><a href="#13">sub menu 3</a></li> </ul> </li> <li class="test"><a href="#">menu 2 <i class="fa fa-plus"></i></a> <ul> <li><a href="#21">sub menu 1</a></li> <li><a href="#22">sub menu 2</a></li> </ul> </li> </u

python - Which one is faster, eliminate a small number of duplicate items from a list or just run it directly? -

at current task. program generate unique list each customer, have 5-10 duplicated items in it, list length 40. i need run program on millions of customers. i'm wondering 1 faster? # plan customer_list = list(set(customer_list)) item in customer_list: #plan b item in customer_list: i use set completed customers. should work faster list. completed_customer = set() item in customer_list: if item not in completed_customer: -do //add here item set:

javascript - Repeating a character across the full width of an element -

i trying write function using javascript , jquery (since i'm using jquery site) detect width of view port , output character repeated across full width. i trying make website looks unix terminal , table headers use equal sign repeat across width of screen (tables set width: 100%; ). know make simple image of equal sign , set repeat-x using css on empty header row prefer text. have been playing around arrays , have far. var windowwidth =$(window).width(); document.write( array( windowwidth ) ).join( '=' ) ); i know broken, left off because haven't been able figure out search terms should using find answer. if wouldn't mind either helping me write or point me in right direction appreciate it. this can improved, by: appending single character body, , width, remove it. divide width of body width of character number of times repeat character. example var $char = $('<span>').css({ padding: 0, margin: 0 }).text('=').a

Unzip .gz file using c# -

how unzip .gz file , save files in specific folder using c#? this first time encounter .gz file. i've search in how unzip yet didn't work me. didn't unzip .gz file in specific folder. don't want used third party application. can gave me sample code on how unzip it. save file in folder. thanks. the following example msdn shows how use gzipstream class compress , decompress directory of files. namespace zip { public class program { public static void main() { string directorypath = @"c:\users\public\reports"; directoryinfo directoryselected = new directoryinfo(directorypath); foreach (fileinfo filetocompress in directoryselected.getfiles()) { compress(filetocompress); } foreach (fileinfo filetodecompress in directoryselected.getfiles("*.gz")) { decompress(filetodecompress); }

How can i deserialize Json string where object's field's subclass is included in json string, using Java and Jackson library -

i new java. have classes site, instances, cloudinstance. class site has attribute instances , class cloudinstance inherits class instance. follows- public class site extends baseentity { private string sitename; list<instance> instances = lists.newarraylist(); } public class instance extends baseentity { private string instanceid; private string name; } public class cloudinstance extends instance { private string availabilityzone; private string instancetype } i deserializing json string follows - import com.fasterxml.jackson.databind.objectmapper; objectmapper mapper = new objectmapper(); baseentity obj = null; obj = (baseentity) mapper.readvalue(jsonstr, site.class); it works fine if jsonstr not contain fields of class 'cloudinstance' , contains field instance instance class's fields. problem - want deserialize jsonstr includes 'cloudinstance' classe's fiels part of 'instances' fi