Posts

java - Trouble Importing Resources with Eclipse -

i'm setting jlabel show icon. public icon geticon(string type) throws ioexception { string avatar = "academic.jpg"; switch(type) { case"academic": avatar ="academic.jpg"; break; case"alchemist": avatar ="alchemist.jpg"; break; case"assassin": avatar ="assassin.jpg"; break; } classloader classloader = thread.currentthread().getcontextclassloader(); inputstream input = classloader.getresourceasstream(avatar); image logo = imageio.read(input); icon icon = new imageicon(logo); return icon; } "input" still null on 3rd line, when "avatar" contains string "pic.jpg". resources folder in src folder? have done wrong? how eclipse know how find images? you passing file name no path of kind unless file located @ root of project, , or classpath not found. need add path details of file located. sounds @ least start with: /sr...

wordpress - How to install missing woocommerce pages from tools menu in woocommerce 2.1.5 -

i new wordpress , have installed woocommerce 2.1.5 skipped logout , change password links during pages install. in woocommerce documentation woocommerce team mentioned there feature add missing pages tools menu when go tools menu cannot see button install missing pages. wonder how can this. there step have missed or need install other plugin button inside tools menu? thanks, aisha this can done by: go "system status" tab on woocommerce click on "tools" tab @ top of page on page, sixth option down called "install pages". clicking "install missing woocommerce pages. pages defined , set not replaced."

ruby on rails - Delete an element in a hash without deleting the model -

i want delete element hash in rails. delete method looks promising, , works 1 unintended consequence... deletes model. # users. @search = user.all # unset yourself. id stored in current_user.id @users.delete(current_user.id) the resulting @users hash in fact have own id removed... deletes model. correct way unset key in ruby / rails? the behaviour describe isn't accurate on many counts. first, user.all returns array, not hash, assuming you're using activerecord here, premise of question flawed. secondly, deleting item array using array#delete not invoke delete on item itself. isn't true. wouldn't hash either. thirdly, also won't delete item array @ all, unless index happens match index of item in array, isn't likely. you're wildly misinterpreting experiment. you don't delete things array passing field belonging object (like id) array#delete . need pass array index. need figure out index of record matching current user, , ...

c# - An entry with the same key already exists? Gridview -

i have gridview control on page , time try use delete button comes it, gives me error mentioned above. here code: <asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" datakeynames="id" datasourceid="accessdatasource1"> <columns> <asp:commandfield showdeletebutton="true" showeditbutton="true" /> <asp:boundfield datafield="id" headertext="id" insertvisible="false" readonly="true" sortexpression="id" /> <asp:imagefield dataimageurlfield="picpath" dataimageurlformatstring="placeimages/{0}" headertext="picture" controlstyle-cssclass="editphotogridformat"> <controlstyle cssclass="editphotogridformat"></controlstyle> </asp:imagefield> <asp:boundfield datafield="pi...

android - Changing background color of a selected List item -

i have menu drawer list has custom arrayadapter. wish change background color of selected list item i'm not sure how to. tried changing in getview of adapter, how others have suggested, didn't work, background color still unchanged. here's tried: public view getview(int position, view convertview, viewgroup parent) { view myview = getitem(position).getview(minflater, convertview); if (myview.isselected()) myview.setbackgroundcolor(color.black); return myview; } where should doing this, , how? thanks. you can using selector below... <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="#ffffff" android:state_activated="false"/> <item android:drawable="#000000" android:state_pressed="true"/> <item android:drawable="#000000" android:state_activated...

javascript - Bootstrap/bootflat and jQuery progress bar -

i trying progress bar display , animate while loading html page div jquery. my progress bar comes bootstrap (bootflat) , looks this: <div class="progress" style="visibility:hidden;"> <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">60%</div> </div> my script looks this: $(document).ready(function(){ $("#btnticker").click(function(){ var ticker = this.form.txtticker.value; $("#progress-bar").show(); $("#info").load('info.php?t=' + ticker, function() { success: $("#progress-bar").hide(); } ); }); }); i can't figure how progress bar displayed , moving; need bit of guidance did google search , couldn't find tutorials beginners (which am). thanks $("#progress-bar...

Avast android anti-virus detected "Android:Looter-Z" [PUP], in my app -

i have app " networking cables ", sent me email, say: "avast android anti-virus detected "android:looter-z" [pup]" in app, when check app no virus. what mean????? i suggest checking post avast . appears there issue in detection whatever definitions user using. recommend updating definitions , trying again. suggest user.