Posts

Showing posts from January, 2013

apache - How to allow server to access files but not user? -

i have directory bunch of files in & don't want able access these files either getting directory listing or guessing file location & typing in.... should not allow them download it. i accomplished putting below in .htaccess file: options -indexes order allow,deny deny however, want user able download file if access via script (which in different directory) give them download. @ moment above settings doesn't work. i thought of putting like.. allow domain.com but i'm not 100% sure means? check request coming & hence work if server requests access dir? ...or still not work user still using domain via other script access dir? if dump files "script" can store files outside documentroot. need no htacces file. perhaps better workaround.

android - Prevent single tap from changing SeekBar progress -

i using seekbar in android app. when user single taps anywhere on seekbar , progress value changed. want progress value change when user slides seekbar thumb (just uislider in ios). i have tried setting clickable property of seekbar false didn't work. how can achieve desired behavior? i faced same issue week , resolved using custom seekbar: following code: public class slider extends seekbar { private drawable mthumb; public slider(context context) { super(context); } public slider(context context, attributeset attrs) { super(context, attrs); } @override public void setthumb(drawable thumb) { super.setthumb(thumb); mthumb = thumb; } @override public boolean ontouchevent(motionevent event) { if (event.getaction() == motionevent.action_down) { if (event.getx() >= mthumb.getbounds().left && event.getx() <= mthumb.getbounds().right && event.gety() <= mthumb.getbounds().bot...

mindmapping - How to i build maps like in mindmeister.com in jquery? -

i wish build site has similar interface of mindmester.. kinda mindmapping functionality.. wanted know built with.. you should @ http://raphaeljs.com/

visual studio 2010 - DSL tools and custom framework -

i want create library operate machine state, defined user. create designer, want use visual studio dsl tools. in examples of dsl tools used generate code. in case need xml file defines states of machine. in case should approach creation of such libraries. should start creating meta? do need 2 times define metamodel? (once designer, once library) do need define in library deserialization of metamodel xml file? this question has been answered in vsvm sdk (dsl) forum on msdn .

asp.net mvc - placment of classes in NerdDinner -

i learning asp.net mvc , looking @ asp.net mvc sample application nerddinner . the folder "models" contains class called dinner.cs . main dinner entity. shouldn't class in other location? example "domain" ? , instead should viewmodel class put in models folder contains dinner information? why file "paginatedlist.cs" located in folder called: "helpers". shouldn't file in folder: "models" since supplied views? any clearification on realy appreciated! sure, thinking right this. nerddinner made concept-presentation purposes , doesn't pretends best practices. becomes more , more obvious own project grows. have domain entities/services/repositories in separate folder, separate project, possibly separate solution. find renamed folder viewmodels make more obvious other people working on project. paginatedlist can viewmodel , contain data related pagination. can put viewmodels folder. believe have in nerddinne...

performance - Intellij IDEA X: any multicore settings to be tweaked? -

i've got nice mac pro 4 cores + hyperthreading. there intellij settings tweaked take advantage of this? either through gui, or editing info.plist file? i'd interested in making gwt compilation/execution faster. (i have localworkers 4 set). thanks i don't know if help, sure looks interesting: http://www.slideshare.net/intelliyole/intellij-idea-architecture-and-performance

iphone - What is an optimal setting for AAC voice recording with AVAudioSession? -

i'm looking record voice on iphone , produce file optimized small size , recording quality voice. settings below aac i'm getting small file size, i'm not sure i'm getting optimal quality. other trial , error, there can turn to, or recommendations? [recordsetting setvalue:[nsnumber numberwithfloat:8000.0] forkey:avsampleratekey]; [recordsetting setvalue:[nsnumber numberwithint:kaudioformatmpeg4aac] forkey:avformatidkey]; [recordsetting setvalue:[nsnumber numberwithint: 1] forkey:avnumberofchannelskey]; [recordsetting setobject:[nsnumber numberwithint:avaudioqualitylow] forkey: avencoderaudioqualitykey]; [recordsetting setvalue:[nsnumber numberwithint: 8000] forkey:avencoderbitratekey]; there several codecs optimized voice, including ilbc . using ilbc @ 8khz sample rate have result in file approximately 7mb per hour of recording.

Visual Studio Project templates -

this question has answer here: templatizing project in visual studio 3 answers i create custom project template in visual studio 2010/2008 , looking resources/information give me starting point. furthermore, need able create custom folders in projects. has had experience that? edit: found more information on matter , trying sum findings , draw conclusions. answer below saw 1 approach of creating project templates another approach found: here which uses vs sdk , exposes new project template called "project template". saw other things gax/gat , starter kits. have experience of approaches? you can read extensive information project templates on msdn . describe in details. also, there information how create custom project templates. should enough start. second approach, sdk used, can find difference , guides on msdn well. there information st...

mysql - Is it possible to count two columns in the same query -

let's have following table structure: t1 ------------- id // row id userid_follower // user follows member userid_following // other member user is possible run single query combine both of following: how many users person following select count(id) t1 userid_follower = ".$myid." ." how many users follow person select count(id) t1 userid_following = ".$myid." thanks. in mysql, can use sum() function on condition, since false condition equal 0 , , true 1 equal 1 : select sum(userid_follower = $myid) followercount, sum(userid_following = $myid) followingcount t1 userid_follower = $myid or userid_following = $myid

install - Cannot have more than one INSTALL_REFFERER receiver in Android Manifest -

i using admob install receiver in android manifest file, e.g. <!-- admob install receiver --> <receiver android:name="com.admob.android.ads.analytics.installreceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.install_referrer" /> </intent-filter> </receiver> however, wish use own install_refferer receiver. problem is, when include own receiver after admob one, never gets called. if include mine before admob receiver in manifest file, mine gets called admob 1 doesn't. is there anyway can both called? thanks android app cannot have multiple receivers have same intent-filtered action. make proxy receiver this: in androidmanifest.xml: <receiver android:name="com.example.app.trackingreceiver" android: exported="true"> <intent-filter> <action android:name="com.a...

ruby on rails - where to store password besides database -

i'm trying build super simple authentication. i'm not sure store admin password. should put password? model, environment or somewhere else.? , how can access enviroment variable if store in environment. thanks! update: i put somethin in environment.rb admin_password = "blablabla" and trying authenticate def authenticate(username, password) password = digest::md5.hexdigest(password).to_s if username == "admin" && password == env["admin_password"] session[:login] = true end end not working... i think no need to_s. all. i'd prefer storing in environment variables if database not option. you can access them like env["db_password"] # => "something_random"

Dynamic File Path in Django -

i'm trying generate dynamic file paths in django. want make file system this: -- user_12 --- photo_1 --- photo_2 --- user_ 13 ---- photo_1 i found related question : django custom image upload field dynamic path here, can change upload_to path , leads https://docs.djangoproject.com/en/stable/topics/files/ doc. in documentation, there example : from django.db import models django.core.files.storage import filesystemstorage fs = filesystemstorage(location='/media/photos') class car(models.model): ... photo = models.imagefield(storage=fs) but, still not dynamic, want give car id image name, , cant assign id before car definition completed. how can create path car id ?? you can use callable in upload_to argument rather using custom storage. see docs , , note warning there primary key may not yet set when function called (because upload may handled before object saved database), using id might not possible. might wan consider ...

filesystems - Java and android file browser issue -

im starting work honeycomb, , im trying make simple fragmented layout list of file on left side, , details of file on right (when file selected). well, going until tried list files, , "/" slash, , thats it. nothing else. set log track number of files in directory im in, , sees 26, wont list them. heres code package com.bv.dual_fragments; import java.io.file; import java.util.arraylist; import java.util.list; import android.app.alertdialog; import android.app.fragment; import android.app.listfragment; import android.content.dialoginterface; import android.content.dialoginterface.onclicklistener; import android.content.intent; import android.net.uri; import android.os.bundle; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.textview; public class fragment_one extends listfragment{ private file currentdirectory = new file("/"); privat...

python - Django want to display help_text -

hello display text in model forms called alternate_id. seem having trouble this. might have written in response context. forms.py alternate_id = forms.charfield(label = 'client no', max_length = 400, required = false, help_text = 'valid wildcard search in format *xx, *xx*, xx*') views.py def search_item(request, client_id = 0): # search form code return render_to_response('search_items.html', {'form':form, 'form.alternate_id':form.alternate_id}, context_instance = requestcontext(request)) search_items.html <form action="." method="post"> <fieldset class="model"> {{ form.as_p }} {{ form.alternate_id.help_text }} </fieldset> maybe should try removing form.alternate_id':form.alternate_id context dict. form should contain alternate_id field , text.

css - Position Div onclick on another div with Multiple instances on a page using JQuery -

here problem http://jsfiddle.net/shoppyonline/re6r7/ i'm trying .req_menu show on each row clicked on. is result you're after? http://jsfiddle.net/2c2yj/ i removed css on .rec_menu it's not absolute, , updated jquery selector match correct .rec_menu div , not of them. update: http://jsfiddle.net/dzmej/

c# - get list of all lists, libraries and pages of a user -

trying list of lists, libraries , pages can accessed user programatically please help!!! start http://msdn.microsoft.com/en-us/library/ms464984.aspx - spweb object lists property. post samples clarify question.

sql server - Sporadic SQL Timeouts with joins, good index -

i have query timeouts in instances not others. using sql server 2008, mvc3, ef. the query rather large (ef code), however, after investigating in qa using exact query that's in profiler), branches use index seek. it's 2 or 3 table join, depending on query (about 4 different ones, 4 variations each based on column i'm querying on). tables have 400k, 100k, 1.2m rows. however, timeouts on 400k - 100k join. paging 50 records @ time, i'm getting timeouts on count as, well. i looking advice on how determine what's causing timeout. since runs , displays on page within 5 seconds in instances , timeouts on others, don't think it's query. rather not increase timeout threshold. i have tried using reports in ssms looking blocking transactions, resource locking, have set read not commited, looked @ profile tables... the 1 thing suspect these tables updated daily, once - utilizing larg delete , bulk import. statitics off or index? rebuild of these index nightl...

asp.net - Adding additional properties to an entity framework 4 code first CTP 5 entity -

i using asp.net mvc 3 , entity framework code first ctp 5 . wondering if possible add additional properties not mapped table column? i haved news class , defined such: public class news : entity { public int newsid { get; set; } public string title { get; set; } public string body { get; set; } public bool active { get; set; } } my database context class: public class mycontext : dbcontext { public dbset<news> newses { get; set; } } in entity class have property defined like: public ilist<ruleviolation> ruleviolations { get; set; } i have not code part yet, want broken rules added list when object validated. error getting is: one or more validation errors detected during model generation: system.data.edm.edmentitytype: : entitytype 'ruleviolation' has no key defined. define key entitytype. system.data.edm.edmentityset: entitytype: entityset ruleviolations based on type ruleviolation has no keys defined. here reposity ...

javascript - Show div with jQuery. css question -

i have 3 divs display: inline-block . in every div have div display: none when im trying show hiding div $('#div-id').show(1000) nearest divs 'jump around' should change? see div under div draw , left or right div doesn't change place. example 2 divs problem there (hide div shows onchange in textbox) http://jsfiddle.net/wzcju/13/ i added css: #amount-div, #specific-div { width: 300px; vertical-align: top } version without width , may better: http://jsfiddle.net/wzcju/15/

iis 7 - Sharepoint 2010 Custom Web Service - The HTTP request is unauthorized with client authentication scheme 'Ntlm' -

i have 2 custom web services built on top of sharepoint. switched servers , upgraded site 2008 2010 on weekend. following errors on each web service when viewed through .net web service wrapper. system.servicemodel.security.messagesecurityexception: http request unauthorized client authentication scheme 'ntlm'. authentication header received server 'ntlm'. ---> system.net.webexception: remote server returned error: (401) and system.net.webexception: request failed http status 401: unauthorized. the web services have dlls live in gac , asmx files live in layouts hive folder. these worked fine before upgrade/server move. what think happening default windows credentials aren't being passed service. web service calls sharepoint web services list content. here's example of 1 of calls returns 401: <webmethod()> _ public function testgetuserinfo() string dim userservice new sharepointuser.usergroup userservice.credentials = syst...

javascript - tinyMce setcontent problem in IE -

the problem tinymce library on wordpress , when run internet explorer( 7 or 8). when add content (like " <h1> hey </h1> "), adds content in firefox/chrome @ right place, in ie, adds start of page (above everything). here code use var txt = "<h1> hey </h1>" ; var ed = tinymce.getinstancebyid(domelementid); // domelementid div id textarea adding content. ed.selection.setcontent(txt); can suggest reason/fix ? thanks. had same problem using tinymce on internet explorer 8, here solution have found: var ed = tinymce.getinstancebyid(domelementid); *ed.focus();* ed.selection.setcontent(txt); the missing part 1 focusing.

Parse varying sized arrays in data structure - Java -

as novice java programmer, i've run rather high hurdle while trying analyze data personal project of mine. have text file ~33.5k data points in following format: pointnumber: 33530 lat: 8.99167773897820e-001 lon: 6.20173660875318e+000 alt: 0.00000000000000e+000 numberofaccesses: 4 0 4.80784667215499e+003 4.80872732950073e+003 0 1.05264215520092e+004 1.05273043378212e+004 1 1.65167780853593e+004 1.65185840063538e+004 1 6.52228387069902e+004 6.52246514228552e+004 the final rows, i.e. ones beginning 0 or 1, correspond integer in number of accesses row. parse through file , print lat, lon, , 2 values following each access instance of pointnumbers having more 1 number of accesses. i'm not sure whether start scanner or tokenizer or compile pattern. technique makes storing valid pointnumbers easier? intuition tells me parse through file, placing relevant values object: pointnumber...

timer - When does JavaScript interval stops? -

it may naive question need know answer. this code, setinterval(function() { / do stth. /}, 1000); i never cancel timer, need run long user on page, need know case memory leak, or when stop (ie, browser refresh, browser close)? the problem can occur when "do something". if have other long running functions or additional intervals inside interval (a la javascript inception) run performace issues. however, in cases, won't have problems. when user refreshes browser, interval begin anew. when browser closed activity stops. as long user doesn't refresh browser or leave page interval never end.

c# - Data base connection create new or reuse? -

i have windows service application polls table data every 5 sec, know should create single connection , reuse everytime or go creating new connection everytime after 5 sec read database. reuse work best. make use of in-built connection pooling feature. http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx

symfony1 - Can you generate relationships with Symfony (using Doctrine)? -

at moment, if following, generates schema.yml: ./symfony doctrine:build-schema but doesn't generate relationships. do have manually add schema.yml or there way generate them? , if have manually enter in, won't over-written next time doctrine:build-schema (to refresh schema new tables, etc)? here schema.yml: companies: connection: doctrine tablename: companies columns: company_id: type: integer(4) fixed: false unsigned: false primary: true autoincrement: true company_name: type: string(100) fixed: false unsigned: false primary: false notnull: true autoincrement: false company_logo: type: string(100) fixed: false unsigned: false primary: false notnull: true autoincrement: false company_date_added: type: timestamp(25) fixed: false unsigned: false primary: false notnull: true autoincrement: false crede...

java - Access file in jar file? -

i need able access file stored in compiled jar file. have figured out how add file project, how reference in code? how might copy file jar file location on user's hard drive? know there dozens of ways access file (fileinputstream, filereader, ect.), don't know how inside itself. you use this: inputstream = this.getclass().getclassloader().getresourceasstream(filefromjarfile); if foo.txt in root of jar file, you'd use: inputstream = this.getclass().getclassloader().getresourceasstream("foo.txt"); assumes class in same jar file resource, believe.

cocoa touch - iPhone send email not using MessageUI -

hi, looking help, new cocoa , iphone programming is there way send email, using standard account configured on device without opening compose ui? i want write app send me email reminders. you have text area type something, when hit button send @ titlebar sends contents of text area email, that's it i have done text area , button thing, opens me compose window, when use mfmailcomposeviewcontroller... or maybe using compose window, hide fields, such to, cc, bcc... all of articles i've found on internet either outdated or mfmailcomposeviewcontroller... looking forward hearing replay you thanks... it possible use mfmailcomposeviewcontroller without user interaction. technique relies on undocumented apis, may break anytime. also, wouldn't idea submit app doing app store… - (void) sendstealthemail { mfmailcomposeviewcontroller *mailcomposeviewcontroller = [[mfmailcomposeviewcontroller alloc] init]; mailcomposeviewcontroller.mailcomposedeleg...

security - replaceAll quotes with backslashed quotes -- Is that enough? -

i'm using replaceall replace single quotes "\\\\'" per colleague's suggestion, i'm pretty sure that's not enough prevent sql injections. i did googling , found this: http://wiki.postgresql.org/wiki/8.1.4_et._al._security_release_technical_info this explains postgresql, replacing not work sql managers? (like, mysql, example?) also, think understand how explanation linked works single backslash, extend situation i'm using 4 backslashes? please note i'm not familiar databases , how parse input, chance learn more! insight appreciated. edit: i've gotten helpful, useful answers. next question is, kind of input break implementation? is, if give me input , prepend single quotes 4 backslashes, kind of input give me inject sql code? while convinced approach naive , wrong, maybe examples better teach me how easy inject sql against "prevention". no, because backslashes? instance if turn ' \' input \' bec...

tsql - Creating a trigger on SQL Server 2008 R2 to catch a record update -

using great plains here , 1 of our users keeps screwing customer data want put trigger on customer table , can find out is. anyway, created table called audit_rm00101 follows: date nchar(10) custnmbr char(15) custname char(65) upszone char(3) salsterr char(15) userid nchar(100) i want capture same fields table want audit wrote trigger follows: create trigger catchcustomerregionupdate on rm00101 update declare @userid varchar(128) select @userid = system_user insert audit_rm00101 select date, custnmbr, custname, upszone, salsterr, @userid updated the trigger gets created fine when try test updating customer record in great plains, great plains throws ugly error , trigger doesn't fired. what doing wrong here? thanks. in trigger, deleted , inserted tables, there no updated , replace from updated from inserted also try fix userid column, audit_rm00101.userid nchar(100) while @userid varchar(128) . edit base...

flash - MovieClip removal in AS3 -

so creating small project fun last night involves creating lot of little circles (star). represent star, created star class. here relevant methods public class star extends movieclip { public function star(r:number) { starradius = r; this.animated = false; this.graphics.beginfill(0xffffff); this.graphics.drawcircle(0,0,starradius); this.graphics.endfill(); this.addeventlistener(event.removed, onremoval); } public function animate():void { if( isnull(angle)|| isnull(speed)){ throw new error("angle or speed nan. failed animate"); } if(animated){ throw new error("star animated"); } if(this.parent == null){ throw new error("star has not been added stage yet"); } this.addeventlistener(event.enter_frame, doanimate, false, 0); ...

orm - Mapping value-type collection in Entity Framework -

similar question: mapping collection of strings entity framework or linq sql i have role class: public class role { public int roleid { get; set; } public virtual ilist<string> actions { get; set; } } i have mapping table in db, "roleactionmapping" columns, "roleid" , "action". "roleid" foreign key point role table, , "action" varchar. cannot seem setup ef mapping populate role class roleactions. any ideas on how achieve this? thanks! ef doesn't offer such mapping. if want map must use: public class role { public int roleid { get; set;} public virtual ilist<roleaction> actions { get; set; } // should initialize collection } public class roleaction { public int actionid { get; set; } // pk must defined or entity readonly public string action { get; set; } public virtual role { get; set; } } you can further extend role class provied not mapped property returning ienumerable...

android - layout with fragment and framelayout replaced by another fragment and framelayout -

edit: so after comments below, revisted , realized hanging me up. imagine client list , client details activity started : public class clientsmainactivity extends fragmentactivity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //studiotabopenhelper db; setcontentview(r.layout.main_client_activity); } } so works great, starts main_client_activity (defined in layout below, , call activity when button on main screen clicked): intent intent = new intent(getactivity(), clientsmainactivity.class); startactivity(intent); easy issue is, clientsmainactivity not call oncreateview or anything, sets layout layout defines fragment, , listfragment. fine cause not trying pass clientsmainactivity , if have hypothetical activity like: sessionmainsactivity called when click on session edit of client, not calling sessionsmainactivity same way (starts activity sets alayout), want layout set defines...

c# - Complex domain model based on companies and not users -

i have few different types of companies can access web application e.g different types of companies: client supplier agent each have own table in database, linked main table company stores common data e.g. address, tel, email, typeofcompany fk relevant table (client etc.)... what best way handle oo throughout app? i like: public class companydto { public int id {get;set;} public string name {get;set;} public address address {get;set;} public string type {get;set;} //type of company //etc... } then inherit class , add aditional properties e.g. public class clientdto : companydto { public string key {get;set;} public address billing {get;set;} } however finding problematic @ times example supplier user wants access: allcompanies, - show list of companies then user supplier company wants view specific companies detail, if client need show clientdto or supplierdto? in instance want show specific companies full details what best way handle this? ...

Android Internal Memory Issue -

i have game published on android market. users reported cannot purchased , downloaded.the price won't show buy. game 70mb, because of sized big internal memory of phone google market disabled purchase? any appreciated. yes, current app package size limit 50 mb, can reduce app package size , add aditional data content 2 separate archives of 2 gb each, or @ least mentioned @ i/o 2011, seen here: http://www.androidpolice.com/2011/05/11/io-2011-google-increases-app-size-limit-to-4gb-tweaks-the-return-policy/ in case, mentioned in same link, regardless if limits ones in use market or not, can make app post-download data needs, through internet, after installation. solution work workaround.

java - 32-bit or 64-bit application on 64-bit OS? -

we developing swing application written java requires 128mb memory, , in short future don't see require more memory 4gb. provide 3 different releases, 1 32-bit windows, 1 32-bit linux , 64-bit linux, installer has jre included. 64-bit version not used until couple of weeks ago, , outofmemoryexception reported because application consumes 40-50% more memory 32-bit version. my question is, needed @ provide 64-bit version 64-bit linux if application never need use more 4gb memory? had quick test revealed 32-bit version works on 64-bit linux. i'm not sure cons have, e.g. performance and/or compatibility issue? check 64 bit java

Windows workflow error handling -

in side wf, want move upper activities based on error code receive @ catch activity. suitable way fix matter? use trycatch activity. need determine whether should rethrow in catch. same structured error handling in c# , vb.net.

internet explorer - What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do? -

what's difference if 1 web page starts with <!doctype html> <html> <head> <meta http-equiv="x-ua-compatible" content="ie=edge"> and if page starts with <!doctype html> <html> <head> <!-- without x-ua-compatible meta --> if there no difference, suppose can ignore x-ua-compatible meta header, since want rendered in standard mode in ie versions. october 2015 update this answer posted several years ago , question should should consider using x-ua-compatible tag on site? changes microsoft has made browsers (more on below). depending upon microsoft browsers support may not need continue using x-ua-compatible tag. if need support ie 9 or ie 8, recommend using tag. if support latest browsers (ie 11 and/or edge) consider dropping tag altogether. if use twitter bootstrap , need eliminate validation warnings, tag must appear in specified order. additional info below: the x-...

javascript - How to get the images src which are in template field of gridview -

<asp:templatefield headertext="picture" itemstyle-height = "150" itemstyle-width = "170"> <itemtemplate> <asp:image id="image1" runat="server" height="150" width="150" imageurl = '<%# eval("picturepath", geturl("{0}")) %>'/> </itemtemplate> <controlstyle height="150" width="150" /> <itemstyle height="150" width="150"></itemstyle> </asp:templatefield> i know how images src using getelementbyid.but requirement image src gridview template field.i want display images src in grid list box.src should src="http://localhost:61027/images/jellyfish.jpg" you should able underlaying data item in gridview rowdatabound event. if listbox id lbimagesource, example, here code you'll want: if e.row.rowtype = datacontrolrowtype.datarow dim drv datar...

iphone - How to remove UIimageView from Superview -

in application adding uiimage on every button click. user can add image number of times clicked button, have attached tag "count1" button, , count increases on every click. can differentiate every image tag. now want remove images, on button click. i tried remove images through following piece of code for (int i=1; i<=count1; i++) { uiimageview *imgremove; [[imgremove viewwithtag:i] removefromsuperview]; } but application crashing when press button. please help... if want remove view form super view @ question (with answer): link

firefox - How to make a 50% transparent window? -

i'm trying semi-transparent window. there's attempt: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window width="400" height="300" style="-moz-appearance: none; background: rgba(255, 255, 255, 0.5); filter:alpha(opacity=50); opacity: 0.5; -moz-opacity:0.5;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <label value="main window"/> </window> although text on window transparent, window not. i've read works panels, not windows, tried both <panel> , <window> none of become transparent. i've tried approaches used here , here , , here . nothing works. any idea? i realized while dragging tab in firefox 3.6.10, shows transparent window. need know how it's done now. i did bit of poking around , found b...

java - dynamic CSS in JSF -

i read this article dynamic css. i generate css based on db parameters. something similar <link rel="stylesheet" href="mydynamiccss.ashx?csscode=mainpage" type="text/css"/> what best way implement in jsf? i using jsf2.0 i rather use servlet purpose, possibly using velocity/freemarker or maybe there existing libraries supporting css generation. href link mapped servlet instead of jsf servlet. haven't seen css taglib jsf.

c# - How to create correct InstanceDescriptor for initializing some properties -

lets have class this: public class foo { public foo {} public int titi { get; set; } public int toto { get; set; } public int tata { get; set; } } i can initialize new instance this: var inst = new foo { titi = 12, toto = 42, tata = 421 }; but how can create correct instance descriptor performs same initialization above? public class fooconverter : typeconverter { // ... public override object convertto(itypedescriptorcontext context, cultureinfo culture, object value, type destinationtype) { if (destinationtype == typeof(instancedescriptor) && value foo) { // incorrect example because properties wont // initialized 12, 42 , 421 var ctor = typeof(foo).getconstructor(type.emptytypes); return new instancedescriptor(ctor, null); } // ... ...

.net - LINQ Update database sort order against a dynamic list -

i have database table sortorder column. display list user , use jquery resort list, save server. after reorder list new list in correct order of ids in database table. i need way update new sort order database. want query database custom sort order based off list of ids user. can step through list , increment sort order 0. bonus points code in vb, although c# fine too. thanks! you can't store sort order in database unless have sort order field in datatable (or association sort order table stores original table's field fk). if have field in linq query do, orderby(x=>x.sortorder) so have database record projection public class objectfromdb{ int id{get;set;} int sortorder{get;set;} } when iqueryable<objectfromdb> queryable , int[] newsortorder , this: var oldsortedlist = queryable.orderby(x=>x.sortorder).tolist() foreach(var i=0;i<oldsortedlist.count;i++;){ oldsortedlist[i].sortorder = newso...

javascript - Is it possible to chain jquery ajax requests as a one level queue (without nesting) -

the question arose idea dynamically load group of javascript files $.getscript. i developing js-only front-ends of couple of projects, share libraries, , nice (or @ least seems) have 1 js file handles common libraries includes, , other 1 - handles specific libraries. some of front-ends talking work widgets other websites, , until setup process of js file compression one, needed place widget single js include, , include dependencies in queue. something like: $.getscript .getscript .getscript so question has 2 parts: 1. make sense? 2. if yes, how? thanks! do mean following: want write $.getscript("js/file1.js").getscript("js/file2.js").getscript("js/file3.js"); and result load 1 file server, contains specified (sort of file1.js + file2.js + file3.js ), don't you? if it, seems impossible, @ least way. makes sense, one, because browser send 1 request instead of 3 (so performance better). implement want, need support server sid...

java - How do I print 1 to 10 in netbeans and print odd and even numbers? -

imprimir del 1 al 10 en neat beans tambien necesito los numeros pares y impares gracias!!!!. spanish english translation question title: how print 1 10 in net beans , print odd , numbers answers question text: print 1 10 in neat beans need , odd numbers !!!!. en espanol: // recorrer todos los números del 1 al 10 for(int i=0; <=10; i++){ if( i%2 == 0 ) // modulo prueba por pares o impares system.out.println ( + " es pares"); else system.out.println ( + " es impares"); } ¿es esto lo que querías? in english: // loop through numbers 1 10 for(int i=0; <=10; i++){ if( i%2 == 0 ) // modulo test or odd system.out.println ( + " even"); else system.out.println ( + " odd"); } is you're asking for?

c# - Asynchronous socket, receive string messages -

good evening, sorry in advance writing don't know error is... my client application receiving server asynchronously. want transfer bunch of stuff @ once (the contents of array, couple of hundred bytes). i want server able send "commands", , have function on client side act according these commands, example if message server reads "print_hello" , should call function prints hello. now, it's understanding when receiving data asynchronously, can't know how of data has been sent (or if more data expected has been sent), need store data in buffer, , when "end of command" (for example, '!' ) sign has been received, should know call function. so far makes sense me, i'm having trouble implementing it. in datareceived callback function, have code: console.writeline("raw data: {0}", data)); mainbuffer += data; console.writeline(mainbuffer); mainbuffer declared volatile static string mainbuffer = ""; first ...

Php for loop array not working -

i'll post, hello, world expecting hello,6 h e l l o , world5 w o r l d instead get hello,6 h e l l o , world5 there 2nd word not spell? $name = $_post['engname']; $convert = array_combine($letters, $jap); function get_num_of_names($name) { $name = explode(" ", $name); $name_mainlen = count($name); for($i=0; $i <= $name_mainlen + 1; $i++) { echo $name[$i]; $name[$i] = str_split($name[$i]); $namelen = count($name[$i]); echo $namelen . '<br/>'; function spellname($x, $namelen) { for($i=0; $i <= $namelen; $i++) { echo $x[$i] . '<br/>'; } } spellname($name[$i], $namelen); } } get_num_of_names($name); you're defining function in loop. script should implode function 'spellname' defined error, if you'd activate error reportin...

javascript - Ajax Request returns undefined result -

i have problem ajax request ( basic function ) here's ajax function function ajax(){ var activexmodes=["msxml2.xmlhttp", "microsoft.xmlhttp"] if (window.activexobject){ (var i=0; i<activexmodes.length; i++){ try{ return new activexobject(activexmodes[i]) } catch(e){ } } } else if (window.xmlhttprequest) return new xmlhttprequest() else return false } here function _2xm.load = function (p, type) { p = p.replace("frame_", ""); loading(type); var req=new ajax(); var __page =encodeuricomponent(p); req.open("get", "page.php?page="+__page, true); req.send(null); req.onreadystatechange=function(){ if (req.readystate==4) { if (req.status==200 || window.location.href.indexof("http")==-1) { loading(2); return req.responsetext; } else { ...

main - C++ - char** argv vs. char* argv[] -

what difference between char** argv , char* argv[] ? in int main(int argc, char** argv) , int main(int argc, char* argv[]) ? are same? first part not have [] . they entirely equivalent. char *argv[] must read array of pointers char , array argument demoted pointer, pointer pointer char , or char ** . this same in c .

objective c - Twitter API - which Library? -

i'm new objective-c/cocoa , want build simple app using twitter api. want access followers of user , because of don't think need complex library mgtwitterengine . is there engine out there needs or should use mgtwitterengine ? i'd recommend getting experience mgtwitterengine. if don't have use entire library, i'm sure you'll want take advantage of later on down road once see it's capable of. can find entire tutorial start finish on creating twitter client mgtwitterengine .

performance - setting private properties of classes -

i have old code uses reflection set properties of objects, e.g this: var properties = obj.gettype().getproperties( bindingflags.public | bindingflags.nonpublic | bindingflags.instance); foreach (var property in properties) { property.setvalue(obj, lookup[property.name]); } i thinking replacing code make faster. because above code allows setting private properties of object, i'm not sure other options there exist. questions: am correct, compiled expressions (using system.linq.expressions) , generated code (using codedom / microsoft.csharp.csharpcodeprovider) cannot used set private properties? would possible using reflection.emit? would of mapping libraries ( automapper , valueinjecter ) (i don't know technology use internally)? are there other options? the open source framework impromptu-interface has static method invokeset uses dlr rather reflection, , call private methods. runs little on 2 times faster reflection in unit speed test case, looks...