Posts

Showing posts from February, 2015

iphone - Change display name per configuration -

is there way change display name of iphone app per configuration (debug/release/adhoc)? i've set can install adhoc builds side-by-side development build or released build able know version/configuration i'm running when @ display name of app on phone. go target settings (project->edit active target). choose appropriate configuration (debug/release). change product name whatever want.

java - Write to CSV that contains comma -

what need write strings csv file, problem string contain , separate string in half. i'm trying send string "fileinfo" below csv said contains , . 1 know how solve greatful! public class fileoutput { public void fileoutputtofile(string hex) throws exception{ string fileinfo = hex; try { printwriter out = new printwriter(new bufferedwriter(new filewriter("myfile.csv", true))); out.print(fileinfo); out.close(); }catch (ioexception e){ } } } you can change delimiter or put quotation marks around values. although, recommend using csv parser such opencsv job you.

loops - Using MATLAB to calculate offset between successive images -

i'm taking images using tunneling microscope. however, scope drifting between successive images. i'm trying use matlab calculate offset between images. code below calculates in seconds small images (e.g. 64x64 pixels), takes >2 hrs handle 512x512 pixel images i'm dealing with. have suggestions speeding code? or know of better ways track images in matlab? help! %test templates template = .5*ones(32); template(25:32,:) = 0; template(:,25:64) = 0; data_a = template; close imshow(data_a); template(9:32,41:64) = .5; template(:,1:24) = 0; data_b = template; figure, imshow(data_b); tic [m n] = size(data_b); z = []; % loop on possible displacements x = -n:n y = -m:m paddata_b = data_b; ax = abs(x); zerocols = zeros(m,ax); if x > 0 paddata_b(:,1:ax) = []; paddata_b = [paddata_b zerocols]; else paddata_b(:,(n-ax+1):n) = []; paddata_b = [zerocols paddata_b]; end ay = abs(y); zerorows = zeros(ay,n); ...

RabbitMQ - Basic newbie questions -

our scenario: dozens of windows laptops connected network. need store simple data records on each laptop, have these reliably transferred service running on network once connection available. considering rabbitmq on each laptop, feeding data "main" rabbitmq on network. fortune 100, , packaging etc concern. question 1: in general, rabbit make sense here? if not, suggestions approach? question 2: when installed on win had manually install erlang first. there packaging/deployment options simpler/more friendly? (their people can normal deployment stuff including create win service, installing erlang on user machines might raise eyebrows...) thanks of who've been there, done rabbit. question 1: need store , forward mechanism. rabbitmq can used that, using shovel plug-in take care of moving messages local rabbit remote 1 (handling reconnection, retries, etc... you). question 2: answer related question 1. rabbitmq+shovel conceptually suitable store , forwar...

How to combine lists in an Android quiz app -

so i'm making quiz show app school (android), , planning user can select, using checklist, chapters wants quizzed on. using 1 list per chapter, easy make quiz chapter, let's check boxes chapter 3,4 , 6. how combine lists questions app have quiz questions in chapters. i planning have around 15 chapters, 15 checkboxes 15c14 possibilites of ways of choosing chapters. how put in programming language shows questions of ticked chapters? also, there way randomize questions in list when put out questions? karan, it looks want using mergecursor shown here: http://developer.android.com/reference/android/database/mergecursor.html you can use combined checked chapters single cursor use adapter display single list.

c++ - cmake, boost::filesystem linking error (undefined directory_iterator.operator!=) -

i'm using cmake (2.8.3), boost::filesystem(1.42.0) in ubuntu 10.10. code compiles ok keep getting following error when linking: cmakefiles/sample.dir/sample.cpp.o: in function `main': sample.cpp:(.text+0x1af8d): undefined reference `int operator!=<boost::filesystem::basic_directory_iterator<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > >(boost::filesystem::basic_directory_iterator<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > const&, boost::filesystem::basic_directory_iterator<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > const&)' collect2: ld returned 1 exit status the code in question following: ...

php - cpanel free alternative with DNS tool -

i'm looking free alternative manage personal sites (php/apache/mysql support) ability configure dns. it should light weight , optimized. i tried many panels kloxo, , disappointed, many bugs , random crashes of whole server. remember, dont want ticketing system or payment system or ability install cms 1 click. important upto date product strong community regular updates , support. i tried googling hours , came big list, confused.. virtualmin the good it creates web sites create them. puts them in home directory, create user/group them. sets ftp/mysql/more. allows extensive customization: example, set websites use chronolog , shorten amount of time takes logrotate. the resources after install (which includes apache, bind, mysql, spamassasin, clamav, dovecot, , postfix. memory usage of entire server 500mb ram (in openvz container after reboot). installation not start additional services, in memory constrained environment, may want disable them before resta...

iPhone: how to tag people on photo as facebook app for iPhone does? -

i'm building native iphone app takes picture, funny stuff it. want users able tag facebook friends on resulting picture, similar facebook app does. seams official facebook ios-sdk https://github.com/facebook/facebook-ios-sdk lacks feature. i wonder: there library or advice can avoiding reinventing wheel? simple go here: http://developers.facebook.com/docs/reference/rest/photos.addtag/ and build photo tag url on right hand side. have send request nsurlconnection, apple has example on how send get's , post's: here apple's example

jquery - AJAX from within a Safari Extension's injected script -

i'm trying expand shorturl using api in injected script in safari extension: $.getjson('http://api.longurl.org/v2/expand?format=json&url=' + encodeuricomponent(href) + '&callback=?', function(data) { console.log(data); }); and i'm getting following error: referenceerror: can't find variable: jquery15103411371528636664_1298845652395 i've tried different api , same error, know not that. also, if execute same code console, successful response. must being inside safari extension's injected script. any ideas? i believe have add jquery plugin first. here's example of how: var newelement = document.createelement("script"); newelement.type = "text/javascript"; newelement.src = "//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"; document.body.insertbefore(newelement, document.body.firstchild); then can jquery in tab using plugin. ;)

user interface - best scripting language\technology to use when building an app that allows to run commands over ssh and via GUI? -

for testing environment want build system can describe below , appreciate feedback on scripting language\technology best doing so. if think there no scripting language suitable task, appreciate feedback. appreciate suggestions on how approach task. thanks. raamee application description: display gui allow me select couple of ips db query. open several ssh connections of selected ips. allow me enter command in gui , run on machines simultaneously. optionally, capture standard output of command in each of ssh connections , display in gui or save in file. for example able following example: query db "which ips available?". lets 2 ips ssh both ips simultaneously. enter in gui command du -h retrieve standard output both ssh connections. display result of du -h command on each machine. tcl/tk expect meet requirements.

android - How can i log out with AndroidAccountManager -

i can login android accountmanager code: http://code.google.com/p/google-api-java-client/wiki/androidaccountmanager but don't know how log out? you don't. when use built-in android authentication, authenticate using username , password user has provided in "accounts , sync" control panel. once have authentication, use obtain auth-token should cache , use until goes bad. so, let's go way access google services using "com.google" style account. end authenticating using accountmanager, when app wants sync (you should using syncadapter this). once authenticate, auth-token. big string of random letters, acts "key" on subsequent web calls. save this, , long it's good, won't need authenticate again. so, want go fetch... let's say, google finance portfolio. include auth-token part of http header. 1 of 2 things happens: google likes token , uses (in place of of username/password pair) authenticate you, , returns...

How would I parse "var coords = {'x' : 982, 'y' : 1002 };" in php? -

var coords = {'x' : 982, 'y' : 1002 }; the above code returned api when access via curl. i need parse x , y values variables. 2 values not same length. i'm not sure best way is. my idea use substr cut off front , it's 'x' : 982, 'y' : 1002 , use explode var ' x' : 982 , 'y' : 1002 , use explode again 982 , 1002 , , remove spaces. i'm unsure if right path or not. right way or way? also, api using meant javascript using php, don't have php api. edit: i have: <?php $result = "var coords = {'x' : 982, 'y' : 1002 };"; $result = substr($result, 13); $result = substr($result, 0,strlen ($result) - 1); $json_obj = json_decode($result); $x_coord = $json_obj->{'x'}; $y_coord = $json_obj->{'y'}; echo 'x:' . $x_coord; echo '<br>'; echo 'y:' . $y_coord; ?> now doesn't seem work. json_decode won't work becau...

php - Tracking visitors to help support -

i looking find way gain information how visitors going through website , if come across errors, errors known along information visitor, when email support have information available. don't want thought of spying on visitor, our audience not provide details problems encounter makes difficult @ times track down incident. have suggestions on php programs might available, or php code handle this? suggestions appreciated me out. thank in advance. i'd highly suggest looking at: http://reinvigorate.net/ tracking how users using site (it has heatmaps show users clicking - , can track visitors on individual basis). - whilst doesn't integrate application (in can't tie information account) - shouldnt 2 hard load reinvigorate , check happened (if have username / ip).

java - How to enable using arrows keys to move row selection in JTable? -

i noticed can arrows move row selection of jtable object when press tab key. possible use arrows after row selection mouse-click (instead of using tab)? in order arrow keys change row selection, jtable must have focus. pressing tab key changes focus next (or first) "focussable" component on page subcomponent in jtable. to focus automatically when becomes visible, add componentlistener componentshown(...) method implemented call jtable's requestfocusinwindow() method. is possible use arrows after row selection mouse-click (instead of using tab) yes; if click mouse on row, should focus row, allowing use arrow keys well. updated : corrected method used input focus, camickr (see comments)

plugins - Downloading source code in Trac -

i'm not able directly download source files project using trac. i understand it's possible use scm client, git or svn this, surely can done without leaving trac! do need plug-in, or there command or configuration i've missed? you don't need plugin this. when using repository browser, "download in other formats" link @ bottom of pages. individual files have "original format" link lets download original file, , folders have "zip archive" link download entire folder. update: also, make sure have trac configured repository paths want make downloadable. in trac.ini, property named downloadable_paths in [browser] section. repository paths listed here (and listed here) made available download through web interface. example, trac.ini has following: [browser] downloadable_paths = /trunk, /branches/*, /tags/* for more information configuration parameter, see official trac documentation trac.ini.

javascript - Run time error in Modal popup extender -

when im using modal popup extender in asp.net pages got "microsoft jscript runtime error: '_popupelement.parentnode' null or not object" run time error every time. know overcome problem. this modalpopup tag remove visisbilty = "false" attribute target panel control. modal popup handle visiblity you. additionally check page codebehind not set visibilty false of target panel. let pop-up magic!

bash - change value in array -

i have problem change value in array. have several arrays: tab1, tab2.... etc. want change value in these arrays using 2 variable: x=2 y=3 tab$y[$x]="#" it doesn't work. me? eval friend: eval tab$y[$x]="#"

c# - How to group Path objects? -

i creating 'map application' in wpf, using c#. use visual blend 2 draw boundaries of countries, result got path objects (written in xaml). path object first point == last point, path closed. countries (like japan) has islands, result 1 country has more 1 path. i trying add behaviors objects (countries - 1 or more paths), when user mouse enter country (or ismouseover property 'true' - doesn't matter here), country changing background color. where country == 1 path, there no problem. can there more 1 path countries? so question is: how group paths in 1 object? i trying use geometrygroup class can't use properly... do have ideas? your path can have more 1 'm' no problem , works fine path.fill. depends on type of figure you're drawing. here's sample: <path data="m10,10 h100 v100 h-100z m30,30 h50 v50 h-50z" stroke="gray" strokethickness="1" fill="blue"/> or g...

algorithm - Dividing 1 by a huge integer -

i have divide 1 number x of more 4000 digits have stored in string , going return floating point number. i'm looking algorithms perform division efficiently not find convinces me. as side note, implement algorithm on own without using third-party library. anyone have idea? thanks! edit : reason why not want use third-party library it's want operation using opencl without losing accuracy in process. therefore using 1 of libraries not possible in case. you describing special case of division, known inverting number. here's paper gives description of picarte's iteration method of inverting large integer: http://www.dcc.uchile.cl/~cgutierr/ftp/picarte.pdf

sql server - duplicate data or better performance? -

we need display our product name in different languages, of them have name in different language english. when query products language, want show default name in english if language name missing. to better query performance, have fill default english name language dependent product name table (languageid + productid primary key) when name language missing. made lots of duplicate name in language dependent table , it's bit difficult update table when default english name changed. currently, have 300,000 products 30 languages , more 8,000,000 rows in table, @ least more 90% data duplicate , fill default english name. if use left join , isnull check in query, query performance slower. who can recommend me better database design can avoid fill duplicate data , have better query performance? the current tables schema below table1 (about 300,000 rows) productid | country | currency | others fields ------------|----------------|-----------|--------------- product ...

oop - Where and why do we use __toString() in PHP? -

i understand how works why practically use this? <?php class cat { public function __tostring() { return "this cat\n"; } } $toby = new cat; print $toby; ?> isn't same this: <?php class cat { public function random_method() { echo "this cat\n"; } } $toby = new cat; $toby->random_method(); ?> can't use other public method output text? why need magic method one? you don't "need" it. defining allows object implicitly converted string, convenient. having member functions echo directly considered poor form because gives control of output class itself. want return strings member functions, , let caller decide them: whether store them in variable, or echo them out, or whatever. using magic function means don't need explicit function call this.

android - Problem in Activity with Spinner and ListView -

my activity has spinner , custom listview , both sourced custom arrayadapters (arraylist of custom objects). listview rows custom views (just 2 textviews). when include line, spinner.setadapter(spinnerarrayadapter); listview not filled data on screen , spinner contains values want. when remove line, spinner.setadapter(spinnerarrayadapter); listview filled data want , spinner not contain values. when debug, see data in listview's custom arrayadapter variable , spinner's custom arrayadapter. i have checked getview() implementation listview's custom arrayadapter class. suggestions? thanks in advance! can paste code identify problem. tested 2 listviews , spinner pointing same adapter. worked fine me.

How can I assign an instance variable without calling its constructor in C++? -

basically, have class called visamux , class called muxpath. muxpath has visamux private instance variable. want muxpath's constructor assign instance variable given visamux object without invoking empty visamux() constructor. 5 muxpath::muxpath(const uint& clk_sel, const uint& lane_sel, const visamux& mux){ 6 clk_sel = clk_sel; 7 lane_sel = lane_sel; 8 mux = mux; 9 } this code results in error: muxpath.cpp:5: error: no matching function call ‘visamux::visamux()’ visamux.h:20: candidates are: visamux::visamux(const std::string&, const uint&, const uint&, const std::vector<visalane, std::allocator<visalane> >&, const std::vector<visaresource, std::allocator<visaresource> >&) as can see, errors on first line (line 5), seems somehow const visamux& mux invoking visamux(), doesn't exist. happens if visamux mux. i don't want call empty constructor visamux because want visamux created pas...

servlets - cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param' -

this web.xml xsd <?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> here servlet node <servlet> <servlet-name>spring1</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <!-- here problem --> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/spring-servlet.xml</param-value> </init-param> </servlet> on marked line xml validator says cvc-complex-type.2.4.a: invalid content found starting element 'init-param'. 1 of '{" http://ja...

iphone - error on adding custom framework in Xcode -

i getting error.... "_objc_class_$_facebook", referenced from: ld: symbol(s) not found collect2: ld returned 1 exit status** when trying use class custom framework. name of class facebook in case. can please suggest me idea how fix problem. there's no way how use dynamically linked custom frameworks in ios application. if want use custom framework, have compile , use static library (physically linked application, iow distributed application). then have set project dependencies, header paths , have link static library ios application. can done in way ... xcode [redacted] - project settings - select target - switch build phases - expand link binary libraries - add static library here , mark required. xcode 3.x - here's example how http://wiki.remobjects.com/wiki/linking_custom_static_libraries_from_your_iphone_xcode_projects

regex - perl regular expression -

i having urls in format. urls contain &abc=4 , not. xxxxxxxxxxxxxxxxxxxxxxxxxxx&abc=4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&abc=4 xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx here xxxxxxxxxxxxxxxxxxxxx string i want match urls have xxxxxxxxxxxxxxxxx , not &abc=4 (meaning want these type of urls, xxxxxxxxxxxxxx , xxxxxxxxxxxxxx , xxx ) i know how write regular expression matches entire url. example: /x.*abc=4/ but how write regular expression matches xxxxxxxxxx , not &abc=4 ? i use negative look-ahead assertion (look ahead not allowed follow pattern) ^(?!.*&abc=4$).*$ this pattern match string not end &abc=4 you can verify online here: http://www.rubular.com/

java - Non resizable window with JFace -

i how it's possible setup non resizable window jface api. consider code below creates application window. can't find methods setup window not resizable on shell object or application window parent. there i'm missing? public class application extends applicationwindow { public application() { super(null); } protected control createcontents(composite parent) { prepareshell(); return parent; } protected void prepareshell() { shell shell = getshell(); shell.setsize(450, 300); } public static void main(string[] args) { application app = new application(); app.setblockonopen(true); app.open(); display.getcurrent().dispose(); } } thanks help. as far understand you, want set shell style bits prior shell creation. simply add @override public void create() { setshellstyle(swt.dialog_trim); super.create(); } to class, so. omits swt.re...

mysql - mysqld: where is the query log file saved? -

i have executed this sudo mysqld --general_log where log file stored? regards javi please have in folder /var/log/mysql/ . by default general_log_file host_name.log . for more see: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_general_log_file

osx - Aptana Studio 3 Full Screen Support -

is full screen support mac stand-alone version of aptana studio 3 going in works? mac os x lion came out yesterday , love full screen apps. i've been trying find way aptana have same functionality. add repo aptana : http://github.bandlem.com/ and install fullscreen enabler.

gcc - Error when compiling Ruby 1.8.7 from source: math.c:37: error: missing binary operator before token "(" -

this odd: : josh@josh; wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.bz2 : josh@josh; tar xvjf ruby-1.8.7.tar.bz2 : josh@josh; cd ruby-1.8.7/ : josh@josh; cflags='-o0 -g -wall' ./configure --disable-pthread : josh@josh; make gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c array.c [...] gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c math.c math.c: in function ‘domain_check’: math.c:37: error: missing binary operator before token "(" make: *** [math.o] error 1 sure enough, math.c cannot compiled: : josh@josh; gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c math.c math.c: in function ‘domain_check’: math.c:37: error: missing binary operator before token "(" there's nothing wrong math.c: static void domain_check(x, msg) double x; char *msg; { while(1) { if (errno) { rb_sys_fail(msg); } if (isnan(x)) { #if defined(edom) errno = edom; #elif def...

c++ - FindWindow is not working? -

i want know why code not working? hwnd hwnds = findwindow(null,(lpctstr)"calculator"); it returns null hwnds.... any idea how fix this? thank :) dont cast string. hwnd hwnds = findwindow(null,_t("calculator"));

c# - Validate XML element against schema -

i need validate small fragment of xml file against schema. essentially, i'd ask question "does element x in xml document y conform type defined in schema z?" , if not message describing why. has account restrictions placed on types (e.g. maxlength, mininclusive). is possible? i don't know doing c#, it's done in xquery or xslt 2.0. in xslt 2.0 it's: <xsl:copy-of select="doc('doc.xml')//selected/element" validation="strict"/> and in xquery it's validate strict {doc('doc.xml')//selected/element} all need schema-aware xquery or xslt 2.0 processor runs in chosen environment.

Are apps published through Adobe Flash's "IPhone OS" packager be approved on the Apple store? -

i this question described on title: apps published through adobe flash's "iphone os" packager approved on apple store? yes see http://www.digitaltrends.com/mobile/adobe-resurrects-flash-tool-after-apple-about-face/ , http://www.adobe.com/devnet/flash/articles/app_store_guide.html

how do you define types if you custom select in a rails query -

my query looks this: @posts = post.includes(:last_comment) .joins("left outer join read_marks on posts.id = read_marks.post_id , read_marks.user_id = #{user.id}") .where(:postr_id => postr.id) .select("posts.*, read_marks.comments_cache rm_comments_cache, read_marks.timestamp last_read_at") but when call @posts.each{|post| post.last_read_at} returns string , not datetime. why don't try using readmark model? @posts = post.includes(:read_marks) .joins("left outer join read_marks on posts.id = read_marks.post_id , read_marks.user_id = #{user.id}") .where(:postr_id => postr.id) @posts.each{|post| post.read_marks.timestamp} this method cleaner, , uses activerecord in way designed. if want use original query, can parse date manually. @posts.each{|post| date.parse post.last_read_at }

oracle - Generating DDL script for object without schema name baked in using DBMS_METADATA.GET_DDL? -

how can generate ddl script object dbms_metadata.get_ddl without schema name baked in? with dbms_metadata.get_ddl : create table "myschema"."mytable" ( "col1" number(10,0) ) sql developer can that, , think it's uses dbms_metadata achive goal , generale ddl scripts. with sql developer: create table "mytable" ( "col1" number(10,0) ) use set_remap_param remap_schema option: dbms_metadata.set_remap_param(th,'remap_schema','hr',null); this map hr schema null (you'll need job handle, though); full example, see metadata_api documentation

How can I get the html form name from php with multiple file uploads? -

if handle file uploads: if ($_files) { foreach ($_files $file) { //...handle upload process } } is there way can key of file? in: <input type="file" name="myfile" /> i want know file coming "myfile". edit: obvious solution turns out be: foreach($_files $key => $file) { $input_name = $key; // handle upload. } if input name in form myfile , in $_files array as: $_files['myfile'] so can do: foreach ($_files $inputname => $fileinfo) { } check out handling file uploads more info.

bioinformatics - Genetic processes help in java -

i need guidance on java project. i'm develop human genetic(family) tree. this subject: each human cell contains 23 pairs of chromosomes numbered 1 22,and pair of sex chromosomes: xx in females , xy in man. during fertilization, 22 chromosomes + (x or y) of man merges 22 + x chromosome of woman. results in 22 pairs of chromosomes + (x or y) in cell form future baby. 23rd chromosome transmitted father (an x or y) determine sex of child (xx girl, xy boy). each chromosome carries many genes (encoding everything, characteristic morphological, physiological, behavioral). due pairs of chromosomes, genetic information duplicated (except parts of sex chromosomes). each copy of gene called allele. means example, if gene responsible color of eye, allele blue. the genetic information expressed consequence of combined expression of alleles being present. dominant allele expressed in genome of bearer. however, if information 1 allele not expressed when dominant allele of same gene pr...

android - What does "category" in the manifest mean? -

the documentation says can specify custom category. when, why , how it? what use of it? the way understand it, categories public directives android operating system(and other apps) represent different categories app should part of. example when launcher icon tapped on home screen, home application looks through every installed app's manifest home category -- , if displays in app drawer. however, there's more. can specify categories in applications manifest lets system know application can handle intent category. example, putting alternative category, other apps in system know app can handle category without knowing action name! in following example, custom intent categories passed through intent, filtered , corresponding object gets edited(taken notes example app): <intent-filter android:label="@string/resolve_title"> <action android:name="com.android.notepad.action.edit_title" /> <category android:name="...

asp.net mvc - IE 8 will no longer accept cookies from localhost -

i had disable cookies testing in web application. reason in ie cannot cookies working on localhost more. work expected in safari, firefox, , chrome, unknown reason cannot life of me cookies working on localhost. have tried literally every setting imaginable absolutely no luck. if change url 'localhost." works expected, when use "localhost", without "." period, cookies absolutely not written. heck did do? tried upgrading ie 9 , didn't work. reverted ie 8 , still have same problem. i'm going absolutely mad trying firgure out causing this. tried tools, internet options, privacy, advanced, , explicit tell browser accept 1st , 3rd party cookies , i'll damned if i'm on localhost site, cookies not written. has worked perfect in past, it's no doubt setting changed cannot life of me figure out hell going on. if has idea of how can remedy this, please let me know. i've tried every setting imaginable absolutely no luck. hate internet...

node.js - Grasping the Node JS alternative to multithreading -

if understand correctly node js non blocking...so instead of waiting response database or other process moved on else , checks later. also single threaded. so mean given node js process can , efficiently utilize single cpu core not use other core on machine, in, never use more 1 @ time. this of course means other cpus can still used other processes things sql database or other intentionally separated cpu heavy subroutines long separate process. also in event node js process has endless loop or long running function, process no longer useful in way until endless loop or long running function stopped (or whole process killed). is right? correct in understanding? pretty correct, yes. node.js server has internal thread pool can perform blocking operations , notify main thread callback or event when things complete. so imagine make limited use of core thread pool, example if non-blocking file system read implemented telling thread thread pool perform read , set call...

ruby on rails - Rails3 + Devise + client_side_validation not working with Devise -

i have following form: =form_for user, :validate=>true |user_form| #avatar_id =user_form.fields_for :profile |p| =p.hidden_field :main_role, :value=>profile::child .field_container =p.label :sex, "child a" =p.select :sex, [["boy", "male"], ["girl", "female"]] ,{:prompt=> "select sex "} .clear .field_container =p.label :first_name, "first name" =p.text_field :first_name .clear .field_container =p.label :last_name, "last name" =p.text_field :last_name .clear ... the form posts users_controller. authentication implemented devise. problem nothing gets validated. no ajax call gets triggered i have tried add :validate=>true :first_name , :last_name did not make difference. here html gets generated: <form novalidate="novalidate" method="post" id="new_user" data-validate="true...

how to compress / minify javascript that has embedded php -

my jquery scripts have php in them initiate variables, etc. i'm trying use minify compress , deter prying eyes. php causing issues. done similar? here example of php-infused javascript: $('input[name=type]:radio').filter('[value=<?=$type?>]').attr('checked', true); $('input[name=cert]:checkbox').filter('[value=<?=$cert?>]').attr('checked', true); $('input[name=gauge]:checkbox').filter('[value=<?=$gauge?>]').attr('checked', true); php attempts separate javascript in way. in php file keep values follows: file.php: <html> <head>...</head> <body> ... <input type="hidden" id ="value_type" value="<?=$type?>" /> <input type="hidden" id ="value_cert" value="<?=$cert?>" /> <input type="hidden" id ="value_gauge" value="<?=$gauge?>...

How do I track incoming SMS messages in Android 2.3? -

i making application in require tracking incoming sms messages. need have sender , message. how accomplish without using deprecated smsmanager? you need set broadcastreceiver listen incoming sms intent. contents pdu's in bundle. there many examples of can found quick search... android incoming sms messages

MySQL Union query duplicate/group by problem -

just learning union queries - timesaver - having trouble grouping. i have following statement: (select `shops`.shpuseradded username, count(`shops`.shpid) shpcount, "" prdcount `shops` group shpuseradded asc) union (select `products`.prduseradded username, "" shpcount, count(`products`.prdid) prdcount `products` group prduseradded asc) but gives me results first query followed results of second query, without combining usernames: username|mercount|prdcount | 8| jane | 1| derek | 1| james | 22| | | 3 jane | | 4 derek | | 5 james | | 21 i tried (but got #1248 - every derived table must have own alias ): select username, shpcount, prdcount ((select `shops`.shpuseradded username, count(`shops`.shpid) shpcount, "" prdcount `shops` group shpuseradded asc) union (select `products`.prduseradded username, "" shpcount, count(`products`...

language agnostic - What does Exclusive in XOR really mean? -

maybe obvious can explain xor (or exclusive-or) got name from? word exclusive mean? not matters, stuck in head since morning. or: 0 0 0 0 1 1 1 0 1 1 1 1 xor: 0 0 0 0 1 1 1 0 1 1 1 0 is "exclusively 0 inputs 1,1", "special version of or" or else? xor "exclusive or" because returns "true" value of 1 if 2 values exclusive, i.e. both different.

string - Textbox, delete button [c#] -

to add new letter textbox use textbox.text = textbox.text + " "; adds space etc., simple but didnt figured out how can delete last line for examp. text of textbox abcdefg and when user clicks delete, text "abcdef" "adcde" etc. how can ? i tried search web failed because dont know how search such thing ^^ string text = textbox.text; if(!string.isnullorempty(text)) textbox.text = text.substring(0,text.length-1);

shell - Multi Piping bash-style in C -

i know there many threads talk problem don't understand way can done. i'm trying make shell can execute linux command sucha ps | grep | less i've donne parsing puting every command , args in linked list. here's implementation doesn't work. hope that's clear enough. if ((son = fork()) < 0) return printerr_sys("unable fork", 0); if (son == 0) { if (first > 1 && data->format[first - 1] && is_directing_elt(data->format[first - 1]) == direct_tpipe) dup2(tube_p[0], stdin_fileno); first = make_argv(data, first, &argv); if (next) { dup2(tube_v[1], stdout_fileno); close(tube_v[0]); } if (execvp(argv[0], argv) < 0) return printerr_cmd(argv[0], 1); } else { if (next) { close(tube_v[1]); cmdline_executer(data, next, tube_v); } waitpid(son, &(data->lastcmd), wuntraced); data->lastcmd = wexitstat...

database - What would you log in a write-ahead log? -

what dbmss implement multi-version timestamp ordering concurrency control include in write-ahead logs ? before , after images, or 1 of them ? timestamps ? else ? documentation of postgres wal . postgres uses mvto type of mvcc. innodb uses mvrc. here postgres log structure , pg_control structure , important recovery. timestamps not used not reliable, rather use monotonically increasing integer counter (transaction id). so rollback related data stored in main data itself, not in wal. main purpose of wal recover data incase of problems due power failure, os problems or hardware failure (obviously except serious disk failures). wal should pretty independent of that. innodb log structure in innodb/include/log0log.h .

html - Classic 'inner div to fill rest of height'-question! -

Image
i've tried find solution matches basic css problems when designed new pages. without luck, though has come close... say have following: a main div wrapper fill 100% height (no problem) an inner div fill rest of height plus contents (scrollable) <-- hard imo. the content div should fill rest of height... the problem if use position:absolute , left:0;bottom:0;top:0; on content ; if contents of content exceeds browser's initial height, happen: ... , page weird-looking. would nice, if div itself, scale contents... :-) how possible? there no way in css (although maybe guru come , show me wrong), may helpful read sticky footers, http://www.cssstickyfooter.com/ also discussed on several threads here, if trying ensure footer won't appear halfway down page. can accomplished purely css, , if absolutely need content div take remaining space (nothing body background shouldn't able take care of..), can use javascript set height of element do...

python - SqlAlchemy Migrate Declarative -

i've modified tutorial on sqlalchemy-migrate tutorial declarative syntax pylons pyramid project. can upgrade , downgrade, i'm concerned base.metadata.drop_all (migrate_engine) command below. here migration file: from sqlalchemy import column sqlalchemy.types import integer, string, datetime sqlalchemy.sql import func sqlalchemy.ext.declarative import declarative_base sqlalchemy.orm import scoped_session, sessionmaker zope.sqlalchemy import zopetransactionextension dbsession = scoped_session(sessionmaker(extension=zopetransactionextension())) base = declarative_base() class user(base): __tablename__ = 'users' id = column(integer, primary_key=true) email = column(string(75), unique=true) fullname = column(string(60)) password = column(string(51)) last_login = column(datetime) date_joined = column(datetime, default=func.now()) def upgrade(migrate_engine): # upgrade operations go here. don't create...

java ee - How to use JPA @Column(unique = true) in a multi-tenant environment? -

i want convert application support multi-tenancy using shared tables (i.e. every table gets tenant id). obviously, not able use @column(unique = true) more, because enforce uniqueness across tenants, don't want. i'm using glassfish 3.1.1 eclipselink. there way make @column(unique = true) force uniqueness per tenant (rather per table). or have enforce in business logic? it possible specify uniqueness constraint on @table annotation, e.g. @table(name = "users", uniqueconstraints = @uniqueconstraint(columnnames = {"tenant_id", "username"}))

.net - Use linq to break up list<t> into lots of list<t> of n length? -

possible duplicate: how can split ienumerable<string> groups of ienumerable<string> i have list break groups of 10. if have object list<person> allpendingpersons that of length m. is there elegant way in linq break allpendingpersons 1 or more list objects have 10 persons? var groups = allpendingpersons.select((p, index) => new {p,index}) .groupby(a =>a.index/10 ); if want process igrouping<,> . if looking list> try var listoflists = allpendingpersons.select((p, index) => new {p, index}) .groupby(a => a.index/10) .select((grp => grp.select(g => g.p).tolist())) .tolist();

php - Regex for matching variable name and value (an array) -

so got problem. have string this: var _0x2804=["\x2c","\x73\x70\x6c\x69\x74","","\x6c\x65\x6e\x67\x74\x68","\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65","\x66\x72\x69\x65\x6e\x64\x73\x65\x6c\x65\x63\x74\x6f\x72\x5f\x69\x6e\x70\x75\x74\x5b\x5d\x3d","\x26\x66\x72\x69\x65\x6e\x64\x5f\x73\x65\x6c\x65\x63\x74\x65\x64\x5b\x5d\x3d","\x50\x4f\x53\x54","\x2f\x70\x61\x67\x65\x73\x2f\x65\x64\x69\x74\x2f\x3f\x69\x64\x3d","\x26\x73\x6b\x3d\x61\x64\x6d\x69\x6e","\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65","\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x78\x2d\x77\x77\x77\x2d\x66\x6f\x72\x6d\x2d\x75\x72\x6c\x65\x6e\x63\x6f\x64\x65\x64","\x70\x6f\x73\x74\x5f\x66\x6f\x72\x6d\x5f\x69\x64\x3d","\x26\x66\x62\x5f\x64\x74\x73\x67\x3d","\x26\x66\x62\x70\x61\x67\x65\x5f\x69\x64\x3d","\x26","\x6a\x6f\x69\x6e","\x26\x7...

wolfram mathematica - How to delete unnecessary options from Notebook[]? -

by default notebook[] has small set of options : in[4]:= options[evaluationnotebook[]] out[4]= {frontendversion -> "7.0 microsoft windows (32-bit) (february 18, 2009)", styledefinitions -> "default.nb", windowmargins -> {{0, automatic}, {automatic, 0}}, windowsize -> {616, 537}} sometimes wish modify notebook appearance , set additional options . example have comments plain rather bold : setoptions[evaluationnotebook[], autostyleoptions -> {"commentstyle" -> {fontweight -> plain, fontcolor -> graylevel[0.6`], showautostyles -> false, showsyntaxstyles -> false, autonumberformatting -> false}}] now options[evaluationnotebook[]] return new option have set. but wish restore default behavior , delete additional options . how can that? igor's answer right. remove options set by setoptions[evaluationnotebook[], autostyleoptions -> {"commentstyle" -> {fontwe...

string - Php str_replace not working -

i've got long string space delimited (read in txt file) input string: $value = "testnumber1 x chan 1 wrap hi (5.0 v) (unc) 9.860 v gele (>= <=) 9.750 10.250 passed" what want do, , have done succesfully explode string array using: $exploded = explode(" ",$value); unfortunatly though, want seperate between gele (>= <=) part, , following number (in case 9.750), thought make easy, before explode string i'll do: $value = str_replace("gele (>= <=) ","gele (>= <=) ",$value); the problem is, reason replace isn't working. it's if it's not seeing needle. exploded string array giving me after doing str_replace. array ( [0] => testnumber1 x chan 1 wrap hi (5.0 v) (unc) [1] => 9.860 [2] => v [3] => gele (>= <=) 9.750 [4] => 10.250 [5] => passed [6] => ) as can see, element [3] => gele (>= <=) 9.750 is there stupid...

python - Subprocess is not invoking my command(or is doing it wrong) -

overview: i have application must make celery- , if simple task such count something- ok. i' ve got 1 task must convert existing file file using ms windows program. so- installed wine, installed application , added folowing task tasks.py: def convert_file( fil, to_format = 'pdf', save_to = '/tmp', callback = none ): devnull = open( '/dev/null', 'w' ) commands = "xvfb-run -a wine '[absolute_path_to_windows_app]' /r /f 104 %s" % fil p = subprocess.popen( commands, shell=true, cwd='/home/test', env=os.environ, stdout = devnull, stderr = subprocess.stdout ) p.wait() devnull.close() if callback: subtask( callback ).delay( ) else: return outfile problem: the command isn't called or called nothing happening(there isn't new file anywhere in filesystem)- if i'll call command bash or interactive python shell, ok. edit: when i'm calling command command line th...

c# - convert number to combination of letters -

i need convert number between 1 , 6000000 letter combination abcde. less letters better. i'm guessing need 4 or 5. can point me in right direction how write algorithm convert numbers letters , back? a-z. (caps). you need convert base-26 numbering: 0 a, 1 b, 25 z, 26 ba, etc. the hexavigesimal wikipedia article has code conversion base 26.

audio - Is aubio cross-compilable for iPhone/Android/ARM? -

anyone know of: a build of aubio library iphone/arm processor? an intro-to-cross-compiling resource can try myself? try using latest git: $ git clone git://git.aubio.org/git/aubio $ cd aubio/ $ ./waf configure build --with-target-platform ios

python - Writing a Binary String to a file -

i writing huffman encoding program compress text file. converted text file huffman encoded value, , need write file. using python "bitvector" module, far slow when reading , writing from/to file. there other ways of doing this(preferably faster)? thanks. you might consider using struct package python standard library.

css - Apply external stylesheet to a particular section -

on website allow user-generated style sheets used. don't want styles affect the whole website, separate section/div. there way that, without going through whole custom style sheet , adding div selector every css rule? example if user has: a, span{color:white;} div{padding:10px;} right have parse out , replace #mysection a, #mysection span{color:white;} #mysection div{padding:10px;} nope, unfortunately there isn't. there no css equivalent <base> tag or similar limit scope of css rule. you have prepend every rule element(s) want apply them to, or load user styled content in iframe.