Posts

Showing posts from April, 2010

javascript - How to get this console in Chrome? -

Image
how chrome console behave 1 in video: https://www.youtube.com/watch?v=yieeimn2khs this mine doing when hit return key: my chrome address bar has following: chrome://blank which same in video. press shift + enter . this enters line break , not "submit" line. note: quite typical systems otherwise "submit" content on enter, e.g. chat systems.

Is it possible to auto change a value after an experation date of a year in MYSQL? -

i have value in row in database needs change automatically 1 0 after year. possible? if so, please redirect me easy understand link explanation how done or explain me how done? i'm beginning , know little. thank you. check mysql event: http://dev.mysql.com/doc/refman/5.7/en/create-event.html example create event myevent on schedule @ current_timestamp + interval 1 hour update myschema.mytable set mycol = mycol + 1;

android - ListView items repeat in BaseAdapter -

i'm pulling data , loading baseadapter list view. currently, items in listview same last item added, list looks this: item 3 item 3 item 3 instead of: item 1 item 2 item 3 i've checked on data sources, , data that's loaded source unique each time. think there's somehting wrong baseadapter, i'm not sure is. here's baseadapter: baseadapter.java arraylist<threadlistdata> mylist = new arraylist<>(); layoutinflater inflater; context context; public threadbaseadapter(context context, arraylist<threadlistdata> mylist) { this.context = context; inflater = layoutinflater.from(this.context); this.mylist = mylist; } @override public int getcount() { return mylist.size(); } @override public threadlistdata getitem(int position) { return mylist.get(position); } @override public long getitemid(int position) { return 0; } @override public view getview(int position, view convertview, viewgroup parent) { if (conv

java - How to avoid Hibernate Validator ConstraintDeclarationException? -

i have webservice based on spring 4, , using hibernate validator (beyond methodvalidationpostprocessor). problem have clientservice interface, , implementation. put bean validation constraints on implementation , forces me put constraints on interface (throwing constraintdeclarationexception ) (or in both of them). i want know 2 things this: why work this? why force me put constraints on interface? reason? is there way put constraints in implementation? thanks in advance! regards to answer first question. behavior specified in bean validation specification section 4.5.5. method constraints in inheritance hierarchies . rule method's preconditions (as represented parameter constraints) must not strengthened in sub types. called liskov substitution principle . to answer second question, there no way @ moment place constraints on implementation class. there hv-872 suggests implement configurable relaxation of these rules hibernate validator specific feature, n

synchronization - Akka and two-way actor conversations -

akka-based actor messaging feels one-way stream/flow of messages "upstream" actor 1 or more "downstream" actors. but there might legitimate use case kind of two-way (request/response) synchronous messaging between 2 actors. instance, might have cacheactor manages cache. other actors might want put , get cache entries cache, , need through cacheactor : // groovy pseudo-code class cacheactor extends untypedactor { map<string,object> cache // ... @override void onreceive(object message) { if(message instanceof getcacheentry) { getcacheentry getcacheentry = message getcacheentry string entry = cache.get(getcacheentry.key) // what? how send actor called this?!? getcacheentry.sender.tell(new getcacheentryresult(getcacheentry.buzz, entry)) // <-- 2. return sender (again 'buzz' sidecar) } } } class fizzactor extends untypedactor { actorref cacheactor

ios - Can't stop audioRecorder -

here's part of code: class audiorecordercontroller: uiviewcontroller, avaudiorecorderdelegate { var audiorecorder: avaudiorecorder? func audiorecordingpath() -> nsurl { let filemanager = nsfilemanager() let documentsfolderurl = filemanager.urlfordirectory(.documentdirectory, indomain: .userdomainmask, appropriateforurl: nil, create: false, error: nil) return documentsfolderurl!.urlbyappendingpathcomponent("recording.m4a") } func audiorecordingsettings() -> nsdictionary {...} func startrecordingaudio() { var error: nserror? let audiorecordingurl = self.audiorecordingpath() audiorecorder = avaudiorecorder(url: audiorecordingurl, settings: audiorecordingsettings() [nsobject: anyobject], error: &error) if let recorder = audiorecorder { recorder.delegate = self if recorder.preparetorecord() && recorder.record() { println("capture succeed!") let delayinseconds

vb.net - Convert DotNetZip ZipFile to byte array -

i've built dotnetzip zipfile several entries. i'd convert byte array can download using download construct below. using wrkzip new zipfile '----- create zip, add memory stream---------- n integer = 0 wrkar.count - 1 wrkfs = wrkar(n) wrkzip.addentry(wrkfs.filename, wrkfs.contentstream) next dim wrkbytes() byte dim wrkfilename string = "test.txt" ===> wrkbytes = converttobytearray(wrkzip) <==== context.response.clear() context.response.contenttype = "application/force-download" context.response.addheader("content-disposition", "attachment; filename=" & wrkfilename) context.response.binarywrite(wrkbytes) wrkbytesinstream = nothing context.response.end() i recognize there zipfile method this: wrkzip.save(context.response.outputstream) however, i've got difficult bug in using that, described here: dotnetzip d

android - camera2basic crashes after taking photo -

i'm working camera2basic example on android 5.0.1 motox 2nd gen have issues. first, example code apparently takes 2 images when tap picture button and second setpreviewtexture failed error. sometimes camera preview restarts, sometime crashes , times gets freeze here logcat output: 06-18 18:49:00.777: w/legacyrequestmapper(17418): convertrequestmetadata - control.awbregions setting not supported, ignoring value 06-18 18:49:00.777: w/legacyrequestmapper(17418): received metering rectangles weight 0. 06-18 18:49:00.778: w/legacyrequestmapper(17418): received metering rectangles weight 0. 06-18 18:49:00.792: d/legacyfocusstatemapper(17418): onautofocusmoving - ignoring move callbacks old af run1 06-18 18:49:00.803: i/requestqueue(17418): repeating capture request cancelled. 06-18 18:49:00.805: w/legacyrequestmapper(17418): convertrequestmetadata - control.awbregions setting not supported, ignoring value 06-18 18:49:00.806: w/legacyrequestmapper(17418): received metering r

templates - C++ Visual Studio 2013 Strange error but code runs -

i trying use __declspec properties , getting strange errors when using multiple indicies. error: "expression must pointer complete object type" in visual studio, code seems run fine. here code using: #include "stdafx.h" template<typename t> class testclass { public: __declspec (property (get = getvalue, put = putvalue)) t test[][]; t getvalue(int x, int y) { return _internalval[x][y]; } void putvalue(int x, int y, t lvalue) { _internalval[x][y] = lvalue; } private: t _internalval[3][3]; }; int _tmain(int argc, _tchar* argv[]) { testclass<int> tc; (int = 0; < 3; i++){ (int j = 0; j < 3; j++){ tc.test[i][j] = * j; } } return 0; } this example using __declspec property on template class using multidimensional property. if remove 1 set of brackets , parameters, seems error goes away , code runs expected. code now, throws error in visual s

javascript - Why aren't my HTML controls responding? -

Image
i'm trying sigma.js prototype working. when click dragnode button should execute javascript add sigma functionality. currently, page loads, none of controls respond (click click cursor inside text box, can't press buttons). debbuging in console reveals no errors. is perhaps simple importing of sigma.js modules disables controls? <!-- start sigma imports --> <script src="js/sigma/src/sigma.core.js"></script> <script src="js/sigma/src/conrad.js"></script> <script src="js/sigma/src/utils/sigma.utils.js"></script> <script src="js/sigma/src/utils/sigma.polyfills.js"></script> <script src="js/sigma/src/sigma.settings.js"></script> <script src="js/sigma/src/classes/sigma.classes.dispatcher.js"></script> <script src="js/sigma/src/classes/sigma.classes.configurable.js"></script> <script src="js/

data modeling - App engine datastore denormalization: index properties in the main entity or the denormalized entity? -

consider classic example of blog data modelling, have blog entity many properties, , want list latest blogs in page. it makes sense denormalize blogpost entity blogpostsummary entity shown in list view, avoiding fetching , deserializing many unwanted properties. class blogpost(db.model): title = db.stringproperty() content = db.textproperty() created = db.dateproperty() ... class blogpostsummary(db.model): title = db.stringproperty() content_excerpt = db.textproperty() the question is: entity should hold indexed properties? there 3 options: 1. index properties in both pros: easy query on both entities. cons: maintaining denormalized indexes expensive. 2. index properties in main entity only pros: indexing properties in main entity more safe, denormalized entity treated redundancy. cons: querying list view need double roundtrip datastore: 1 key-only query blogpost entities, followed batch blogpostsummary . 3. index in denormalized entit

ios - Swift: Remove ads different scene in Spritekit -

i'm using mopub banner ad, added following code view controller's viewdidload: self.adview.delegate = self self.adview.frame = cgrectmake(0, self.view.bounds.size.height - mopub_banner_size.height, mopub_banner_size.width, mopub_banner_size.height) self.view.addsubview(self.adview) self.adview.loadad() but makes ad visible in scenes when want visible in main menu scene. how remove ad in scenes don't want be? this might not best way this, simplest. use nsnotification broadcast message viewcontroller whenever wish show or hide banner. for instance if add "observer" in viewcontroller on init or viewdidload : nsnotificationcenter.defaultcenter().addobserver( self, selector: "hidebannerad", name: "hidead", object: nil) to make viewcontroller listen message called "hidead" , execute method called hidebannerad . then implement method: func hidebannerad(){ self.adview.h

java - Reloading classes with maniupulated bytecode from rt.jar -

i trying track method calls learning purposes. the javagent have implemented modified version of implementation in this article . programm adds method call logging instructions bytecode. unfortunately bootstrap classloader refuses load manipulated content rt.jar. can understand isn't idea production enviroment, student amazing. do got ideas how make happen? i manipulate classes rt.jar. for example manipulated bytecode of bigdecimal class. class training manipulate? , kind of manipulation doing? adding logs every method of class in article mentioned? in additional of following instructions of article, had other things in order able manipulate classes of rt.jar. in loggeragent class added array of classes explicitly want manipulate. string[] includearr = new string[] { "java/math/bigdecimal" }; arraylist<string> include = new arraylist(arrays.aslist(includearr)); in transform method of loggeragent class modified loop include classes exp

function - Python 3 random.randint() only returning 1's and 2's -

i thought i'd worked out kinks in dice rolling code wrote practice, apparently forgot save work last night, , when rewrote afternoon, random.randint function didn't seem returning numbers other 1's , 2's, before remember returning higher numbers when given larger sizes of dice. ran rolling function in shell , seemed working fine, think there must wrong overall code that's causing treat every roll 1d2. import random die = 0 num = 0 def opening(): print ("welcome super deluxe diceroller mk. 3!") print ("what sort of dice roll") choice() def choice(): print ("a. d2") print ("b. d4") print ("c. d6") print ("d. d8") print ("e. d10") print ("f. d12") print ("g. d20") print ("h. d100") global sides die = input() if die == 'a' or 'a': sides = 2 nombre() elif die == 'b'

Powershell string work -

this first question here , i'm new powershell. i have folder $home\devoluciones\ several files named dtoxxxyyyymm.dat xxx company number, yyyy current year , mm stands current month. what need copy files folders named company number, example if have dto509201506.dat , dto908201506.dat need copy files $destination\509\ , $destination\908\ respectively. till have following code: #list items , send a.txt ls $home\devoluciones\dto*.dat | select -exp name > $home\a.txt #from a.txt keep first 6 characters , send b.txt get-content $home\a.txt | foreach {$_.remove(6)} | add-content $home\b.txt #from b.txt replace dto "" , send c.txt get-content $home\b.txt | foreach {$_ -replace "dto",""} | add-content $home\c.txt #from c.txt copy files destination get-content $home\c.txt | foreach {copy-item $home\devoluciones\*$_*.dat $destination\$_\} #clean temp files remove-item -erroraction ignore $home\a.txt -force remove-item -erroraction ignore $home

c++ - "Expression: vector iterator not deferencable" run-time error -

the following code inputs words , counts how many times each word appeared in input. program prints each word , corresponding frequency in order lowest highest. #include <iostream> #include <map> #include <vector> #include <string> using namespace std; int main() { string s; map<string, int> counters; map<int, vector<string> > freq; while (cin >> s) ++counters[s]; map<string, int>::const_iterator = counters.begin(); (it; != counters.end(); ++it) { freq[it->second].push_back(it->first); } (map<int, vector<string> >::const_iterator = freq.begin(); != freq.end(); ++i) { vector<string>::const_iterator j = i->second.begin(); cout << i->first << '\t' << *j; while (j != i->second.end()) { ++j; cout << ", " << *j; }

python - How do I create a file chooser using Tkinter? -

i've been trying create file chooser using tkinter. want make happen when "select file" button pressed. problem, however, automatically opens instead of opening gui , creating file directory window after clicking button. not creating properly? #creates top button/label select file this.l5 = label(this.root,text = "boxes file:").grid(row = 0, column = 0) this.filename = stringvar() this.e3 = entry(this.root,textvariable = this.filename) this.button3 = button(this.root,text = "select file",command=filedialog.askopenfilename()).grid(row = 0, column = 7) mainloop() it's not technically required, should use standard self instead of this . something a = button(root).grid() saves result of grid() a , a point none . create , assign widget first, call geometry manager ( grid() , etc.) in separate statement. a widget's command function widget call when requested. let's we've defined def search_for_foo(): ... . search_for_fo

javascript - JS Object strange behaviour when trying access Loopback related model query -

i working loopback framework, doing web project. think question exposing here has less this, general javascript / node.js knowledge. at 1 part of code, doing: rolemapping.find({ where: { principaltype: 'user', principalid: context.principals[0].id }, include: 'role' }, function(err, roles){ console.log(roles[0]); (var in roles) { if (roles[i].role.name === 'teamleader' && roles[i].groupid === context.modelid) { cb(null,true); }else { cb(null,false); } } }); ok this, fails when trying compare roles[i].role.name . so, went logging roles[i] object contained. { groupid: 1, id: 3, principaltype: 'user', principalid: 1, roleid: 2, role: { id: 2, name: 'teamleader', description: 'the leader(s) of team', created: nul

Prevent the OS from swapping objects to virtual memory/disk in Java? -

so have program has user enter passphrase. hold passphrase few seconds in char[] before overwriting wondering if there way in java prevent os swapping bit disk/virtual memory/any more permanent storage ram? research on topic seems no, there not way no has given me straight answer yet. i'm not sure if can achieve using mlock() somehow or keeping reference value active until no longer need it. thanks! what need is: use char[] storing passwords. , when done password, on write array 0's, if attacker tries scan memory find password, , java gc has not gotten rid of variable till then, attacker not able retrieve password because have on written array itself. cheers. edit: when kernel starts using hdd offload stress on ram, space on hdd acts ram, meaning not permanently store data given it.

Coreos on hyper-v, failed to start switch root -

i tries start coreos on hyper-v fails load iso failed start switch root error i use .vhd disk , generation 1 virtual machine it greediness, coreos need have @ least 1024 mb of ram, otherwise fails load iso

Does rails set anything in a mysql database? -

basically, if have 2 rails applications, different database.yml settings, both connecting same database, conflict each other? or database.yml specific local application? essentially, rails create raw database connection mysql workbench would? or there more it? the .yml file simplyba connection config app. totally fine connect same app different .yml

Using C programming to call VHDL implementation -

i'm thinking writing c function passes array/vector of real numbers vhdl implementation argument , vhdl code computation using array in fpga , returns result c function. so, question - how go writing c function call vhdl implementation? can guide me in right direction tutorial,api or anything? any appreciated. thanks! :) vhdl not result in run time routine, turns actual implementation in hw. able communicate vhdl routine to/from high level lalnguage in cpu, cpu , vhdl module must connected , vhdl code must have proper mean provide data cpu. in case, there 2 ways, 1 vhdl implemented in way shared data can accessed both cpu , fpga logic, in case, need know address is. other way if vhdl providing data via serial port, or usb or ethernet cpu, in both cases, must supported vhdl routine. in case, need know lot more fpga making procedure call. this article might bit understand things works (might not right fpga either, helps anyway). how interface fpgas microcontrol

java - Passing data RecyclerView data to another activity on click -

i in process of passing information recyclerview activity called "partyinformation", in respective clicked cell. information in recyclerview fetched parse.com. recyclerview consists of textviews imageviews , populate "partyinfomation" data. when compile , run receive no errors when cell clicked recyclerview app quits , reads "unfortunately, app has stopped". the logcat prompts error: java.lang.classcastexception: android.support.v7.widget.appcompattextview cannot cast android.os.parcelable. can please review code , identify went wrong in process of trying pass data on click? main activity package com.example.jbobo_000.prac; import android.content.context; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.os.bundle; import android.support.v4.widget.drawerlayout; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.linearlayoutmanager; import android.support.v7.widget.recyclervie

java - Take results from JDBC and turn into JsonObject -

i trying results jdbc , turn them json objects , finding difficult do.. have connection con = null; preparedstatement ps = null; resultset rs = null; try { con=db.getconnection(); string query = "select city,state zips zip=10012"; ps=con.preparestatement(query); string line=""; while(rs.next()) { line= rs.getarray("city").tostring(); } jsonobject jsonobj = new jsonobject(line); as can see trying results of while loop , put them string variable , put jsonobject. this not working, have suggestions? i've been looking around , tweaking code , nothing works. if makes difference using java 1.8 jdk. database connection works , have tried query within mysql in code. update: getting blank page when check see output query. reason want in json because supposed restful service android. rs.next() being used loop out of results query. here subroutine wrote, should solve problem. @ least works me, us

javascript - Representing Ranges of Time with Different Units in a Comparable Way -

i have event objects have lifespan attribute. have varying types of events, each different lifespans , potentially different units (e.g. 4-10 hours, 5-8 weeks, 1 month - 2 years). want store these ranges uniform , comparable datatype i'm not sure best option is. ideally want able go through list of events , find can last 3 hours, 1 week, 2 months, etc. the problem having comparing values same "substance" (i.e., time) yet have different units. great candidate value object . value objects not common pattern in javascript, no less applicable , great place domain logic. this article great @ using value objects javascript. create "class" defining javascript function. in it, store value lifespan in smallest units use (hours). create several internal methods , set value based on unit type (for example, multiplying weeks 168 number of hours). may want round nearest week/month/year when getting in units. create methods compare value in hours val

android - Adding a Custom Class View in XML -

i have following xml source <view android:layout_width="fill_parent" android:layout_height="150dp" android:id="@+id/plotviewmodel" /> if use view, see other views on content. since view oxyplot (class), directly changed within xml . however, content page put other views properly. however, when build , run project, loads. know there other way it? <oxyplot.xamarin.android.plotview android:layout_width="fill_parent" android:layout_height="150dp" android:id="@+id/plotviewmodel" />

html - Bootstrap 3.3.2 - Can I have more than 12 rows? -

i trying split row space have 13 columns, not 12. every time had 13th column row breaks rows, regardless of width of container. 12 fixed/ how define 13 columns? i tried: <div class="col-lg-13"> <div class="row little-padding"> i tried: <div class="row little-padding col-lg-13"> but still, 12 per row remains... you can create custom version of bootstrap, , specify number of columns want work via official site. http://getbootstrap.com/customize/#grid-system that link takes directly grid system components.

opengl es 2.0 - GLSL noise function on devices with no high precision fragment shader -

Image
i'm looking noise function wich working on none highp fragment shader. what have tried: //http://stackoverflow.com/questions/4200224/random-noise-functions-for-glsl float snoise(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } //http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ float snoise(vec2 co) { float = 12.9898; float b = 78.233; float c = 43758.5453; float dt= dot(co.xy ,vec2(a,b)); float sn= mod(dt,3.14); return fract(sin(sn) * c); } main: void main() { vec4 texcol = texture2d(utexdiffuse, vtexcoord.xy); float n = snoise(vec2(vtexcoord.x*cos(utime),vtexcoord.y*sin(utime))); gl_fragcolor = texcol; gl_fragcolor.rgb *= n; } both working fine on device supports high point fragmentshader precision. on device nexus 7 not working. i tried shader repository: webgl-noise not working. result on highp supporting fragment shader (looking fine):

java - Webapp won't run uder Tomcat 8.0.23 -

i have web app running in tomcat 7 , tomcat 6. when try migrate tomcat 8 won't let me, there exceptions one: javax.servlet.servletexception: la ejecución del servlet lanzó una excepción @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:314) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ mx.com.vw.servlet.filters.stylizerfilter.dofilter(stylizerfilter.java:112) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:239) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:206) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.ja

asp.net - DotNetZip download works in one site, not another -

edit - resolved: difference in "main" case download initiated via callback cycle, , in "test" case initiated through server side button click function. guess download request , callback cycle interfered each other, both stopping download , causing page become inactive (as described below). when rewired download on main page start submit instead of callback, did initiate download. this in vs2013 ultimate, win7pro, vb.net, websites (not projects),iisexpress. i built test site develop functionality creating openxml pptx , xlsx memorystreams , zipping , downloading them using dotnetzip. got work fine. merged code "main" site. both sites on same machine; can run test site , main site @ same time. main site processing more complicated, in terms of accessing , downloading more files. however, zip , download function (below) works fine in test site, exact same code doesn't work in main site (with or without test site , running). there'

automatic ref counting - Swift weak self function retention -

if have closure references weak var weakself = self , can change closure direct function reference, through weakself ? struct closureholder { let closure: () -> void } class closuresource { func hello() { nslog("hello") } func createweakselfwithininnerclosureclosureholder() -> closureholder { weak var weakself = self return closureholder(closure: { weakself?.hello() }) } func createweakselfdothelloclosureholder() -> closureholder { weak var weakself = self // code below won't compile because weakself optional. // once unwrap optional, no longer have weak reference. // return closureholder(closure: weakself.hello) // strongifies weak reference. :( return closureholder(closure: weakself!.hello) } } instead of createweakselfwithininnerclosureclosureholder , i'd prefer createweakselfdothelloclosureholder . no can't. sayi

java - Minecraft plugin WorldEdit get region -

i'am trying resolve owner of region far have stuck trying select region code: package pl.maccraft.regs; import java.util.logging.logger; import net.milkbowl.vault.economy.economy; import org.bukkit.plugin.registeredserviceprovider; import org.bukkit.plugin.java.javaplugin; import org.bukkit.bukkit; import org.bukkit.chatcolor; import org.bukkit.material; import org.bukkit.world; import org.bukkit.block.block; import org.bukkit.block.sign; import org.bukkit.entity.player; import org.bukkit.event.eventhandler; import org.bukkit.event.listener; import org.bukkit.event.player.playerinteractevent; import com.sk89q.worldguard.bukkit.regioncontainer; import com.sk89q.worldguard.bukkit.worldguardplugin; import com.sk89q.worldguard.domains.defaultdomain; import com.sk89q.worldguard.protection.managers.regionmanager; import com.sk89q.worldguard.protection.regions.protectedregion; import org.bukkit.plugin.plugin; public final class egs extends javaplugin implements listener {

c# - How convert a list to int[][] -

i have class piece define each piece shape. myshape.add(new piece { height = 3, width = 2, name = "3x2 l topright", size = 4, shape = new int[][] { new int[] { 1, 0 }, new int[] { 1, 0 }, new int[] { 1, 1 } } }); but create shape hand, reading pieces in real time, create like list<int[]> virtualrow = new list<int[]>(); virtualrow.add(new int[] { 1, 0 }); virtualrow.add(new int[] { 1, 0 }); virtualrow.add(new int[] { 1, 1 }); so how can create shape using virtualrow ? i try shape = new int[][] { virtualrow.toarray() } but cannot implicitly convert type 'int[][]' 'int[]' virtualrow.toarray() already array of array of int values. don't need create new array of array of ints , add it. all need is: shape = virtualrow.toarray(),

swift - Why am I getting 'fatal error: Array index out of range' with this code? -

Image
i have following constants class declared such. whenever outside class calls constants.drawingtypes or constants.colorflags , following error: fatal error: array index out of range i'm afraid might misunderstanding static keyword, intent of methods , members of class arrange set of constants , arrays of used in application. is there obvious error i'm missing here, in declarations or otherwise? import foundation class constants { enum drawingtypes: string, printable { case = "any" case line = "line" case cubicbezier = "cubic bezier" case squarebezier = "square bezier" case linefilled = "line filled" case cubicfilled = "cubic filled" case squarebezierfilled = "square bezier filled" case multilayer = "multilayer" var description: string { return rawvalue } } enum colorflags : string, printable

asp.net mvc 4 - Azure blobs - cannot display image store in blob container in MVC 4 -

Image
question background: i have basic mvc 4 site , trying display picture stored in blob storage container in azure cloud account. store list of image uri's in string list , pass these view should display the issue: i can't seem file name of image stored in container. the following image shows container in azure. note there image stored in size of 101.28kb: this code trying use retrieve blobs , read image uri's : azurestoragecontroller pics action method: public actionresult pics() { var imagelist = new list<string>(); var imagesazure = new myblobstorageservice(); var container = imagesazure.getcloudblobcontainer(); foreach (var blobitem in container.listblobs()) { imagelist.add(blobitem.uri.tostring()); } return view(imagelist); } the getcloudblobcontainer method of myblobstorageservice class: public cloudblobcontainer getcloudblobcontainer() { s