Posts

Showing posts from September, 2012

asp.net - Using Navigation properties? -

asp.net - Using Navigation properties? - im trying set foreign key with protected void adresdetailsview_iteminserting(object sender, detailsviewinserteventargs e) { var id = convert.toint32(customerdropdownlist.selectedvalue); e.values["customer_id"] = id; } this not work because entity (adres) not have property customer_id. customer_id column name in database , should utilize client property wich navigation property. dont know how to. i'm using ef 4.5 the simplest way modify navigation properties utilize foreign key properties. allow class have both customer , customerid / customer_id /whatever want property, kept synchronized. can update client id way you're trying now. however, don't specify version of ef using, , older versions not back upwards foreign key properties. if foreign key properties not option, need create sure client id id exists in context. var client = cont...

How to migrate apps from windows 6.5 to Windows RT (ARM)? -

How to migrate apps from windows 6.5 to Windows RT (ARM)? - i want migrate existing working application written in windows 6.5 phone windows 8 rt (arm). i searching if can using tools or have manually? expecting links more detailed documents , information thanks in advance you need manually, there no automated tools it. win rt lite version of windows 8, many libraries either not available, or references different. windows-ce windows-rt

Javascript password - remember the user's input -

Javascript password - remember the user's input - i next js password script: <script language="javascript"> var password; var pass1="hello"; password=prompt('please come in password view page!',' '); if (password==pass1 ) alert('password correct! click ok enter!'); else { window.location="test.html"; } </script> i password remebered in pop-up box after user enters it, whether it's right or wrong. or even... if user enters right password page 'remembers' (cookie) user has been successful , doesn't inquire password 1 time again until browser closed down. i hope makes sense. you can store authorisation status in cookies with: document.cookie = 'authorized=1'; and later check with: if (document.cookie.match(/\bauthorized=1\b/)) { //do } javascript password-protection

actionscript 3 - Very small 3d rendering -

actionscript 3 - Very small 3d rendering - i'm writing little piece of code on 3d model rendition based on post: http://active.tutsplus.com/tutorials/3d/quick-tip-displaying-a-3d-model-with-papervision3d/ i downloaded free dae file (car_shell_001.dae) , texture (vehicle_texture.jpg). i copied code example, changing file pointer files. here's code: public class tarini extends basicview { [embed(source="assets/car_shell_001.dae", mimetype="application/octet-stream")] private var bikemodelclass:class; [embed(source="./assets/vehicle_texture.jpg")] private var biketextureclass:class; private var bikemodeldae:dae; public function tarini() { this.loaderinfo.addeventlistener ( event.complete, onfullyloaded ) ; } private function onfullyloaded(e:event):void { var bitmap:bitmap = new biketextureclass ( ) ; var b...

javascript - dynamic show and hide of radio buttons based on output of another radio button -

javascript - dynamic show and hide of radio buttons based on output of another radio button - i'm working next html: <div class="form"> <input type="radio" name="type" value="100" checked="checked" />100 <input type="radio" name="type" value="200" />200 <input type="radio" name="type" value="300" />300 <input type="radio" name="type" value="other" />other </div> <input type="radio" name="img" value="100"/> img1 <input type="radio" name="img" value="200"/> img2 <input type="radio" name="img" value="100"/> img3 <input type="radio" name="img" value="200"/> img4 <input type="radio" name="img" value="300"/> img...

python - How to get size of remote file? -

python - How to get size of remote file? - how size of remote file after upload file, using sftp paramiko client ? ? ssh = paramiko.sshclient() ssh.set_missing_host_key_policy(paramiko.autoaddpolicy()) ssh.connect( cs.host, username = 'test', password = 'test', timeout=10) sftp = ssh.open_sftp() res = sftp.put(filepath, destination ) ? use .stat() method: info = self.sftp.stat(destination) print info.st_size the .stat() method follows symlinks; if not desirable, utilize .lstat() method instead. see sftpattributes class information attributes available. .st_size size in bytes. python paramiko

arrays - How do I tokenize a string in Javascript? -

arrays - How do I tokenize a string in Javascript? - i have string: '"apples" , "bananas" or "gala melon"' i convert array arr = ['"apples"', 'and', '"bananas"', 'or', '"gala melon"'] i don't know if can regular expression. i'm origin think may have parse each character @ time match double quotes. input = '"apples" , "bananas" or "gala melon"' output = input.match(/\w+|"[^"]+"/g) // output = ['"apples"', 'and', '"bananas"', 'or', '"gala melon"'] explanation regex: / - start of regex \w+ - sequence of word characters | - or "[^"]+" - quoted (assuming no escaped quotes) /g - end of regex, global flag (perform multiple matches) javascript arrays string

wicket - Null-check manually converted TextField value -

wicket - Null-check manually converted TextField value - i have textfield overrides it's getconverter method add together joda time converter instead: class="lang-java prettyprint-override"> new textfield<p>(id) { @override public <p> iconverter<p> getconverter(class<p> type) { homecoming (iconverter<p>) new jodadatetimeconverter(); } }; the converter returns null if input invalid. however, want able flag field required, , don't know how that: textfield.isrequired(true) not work, because required checks done before conversion. doesn't work non-empty invalid inputs. textfield.add(.. validator ..) not work because no validator called if converter returned null. i don't see approach flag date fields required. know how that? approach not suited @ all? if add together inullacceptingvalidator instead of regular one, called null values too. subclassing validators homecoming true on val...

search - how to make snippet trimmed to a human readable sentence - php -

search - how to make snippet trimmed to a human readable sentence - php - first give thanks helping me create nice search result query. hope friends can help me improve it. here query $searchresult = $mysql->query("select * pages pagecontent '%$searchterm%'"); if($searchresult->num_rows > 0) { while (($row = $searchresult->fetch_assoc()) !== null) { echo '<h3>' . $row["pagetitle"] . '</h1>'; $position = strpos($row["pagecontent"], $search); $snippet = substr($row["pagecontent"], $position - 200, $position + 200); echo $snippet . '<hr><br />'; } } else { echo "<p>sorry, can not find entry match query</p><br><br>"; } what create snippet trim in such way not break word sentence readable .... , if possible create search term appear in bold. dear friends need help in doing so. g...

css - SASS Combining Variables to Form Unit -

css - SASS Combining Variables to Form Unit - this question has reply here: adding unit number in sass 1 reply how combine 2 variables in sass form single unit? setup follows: $font-size: 16; $font-unit: px; $base-font-size: {$font-size}{$font-unit} !default; @if unit($base-font-size) != 'px' { @warn "parameter must resolve value in pixel units."; } this throws compile error: invalid css after ... expected look ... was thanks help! try instead: $font-size: 16; $font-unit: 1px; $base-font-size: $font-size * $font-unit !default; @if unit($base-font-size) != px { @warn "parameter must resolve value in pixel units."; } css sass

python - increase tcp receive window on linux -

python - increase tcp receive window on linux - similar setting tcp receive window in c , working tcpdump in linux , why changing value of so_rcvbuf doesn't work?, i'm unable increase initial tcp receive window greater 5888 on ubuntu linux 2.6.32-45 #!/usr/bin/python socket import socket, sol_socket, so_rcvbuf, tcp_window_clamp sock = socket() sock.setsockopt(sol_socket, so_rcvbuf, 65536) sock.setsockopt(sol_socket, tcp_window_clamp, 32768) sock.connect(('google.com', 80)) tcpdump says: me > google: flags [s], seq 3758517838, win 5840, options [mss 1460,sackok,ts val 879735044 ecr 0,nop,wscale 6], length 0 google > me: flags [s.], seq 597037042, ack 3758517839, win 62392, options [mss 1430,sackok,ts val 541301157 ecr 879735044,nop,wscale 6], length 0 me > google: flags [.], ack 1, win 92, options [nop,nop,ts val 879735051 ecr 541301157], length 0 sysctl -a | grep net.*mem says: net.core.wmem_max = 131071 net.core.rmem_max = 131071 net.core....

c# - How can i make that if an item in a listBox is out of the bound on the right so it will move one line down? -

c# - How can i make that if an item in a listBox is out of the bound on the right so it will move one line down? - i have code in new form add together text textbox , it's added listbox item: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace gatherlinks { public partial class changelink : form { public changelink() { initializecomponent(); } public string gettext() { homecoming textbox1.text; } private void button1_click(object sender, eventargs e) { if (!string.isnullorempty(textbox1.text)) { dialogresult = dialogresult.ok; } else { } } private void changelink_load(object sender, eventargs e) { this.accep...

knockout.js - How do I swap two items in an observableArray? -

knockout.js - How do I swap two items in an observableArray? - i have button moves item 1 position left in observablearray. doing next way. however, drawback categories()[index] gets removed array, discarding whatever dom manipulation (by jquery validation in case) on node. is there way swap 2 items without using temporary variable preserve dom node? moveup: function (category) { var categories = viewmodel.categories; var length = categories().length; var index = categories.indexof(category); var insertindex = (index + length - 1) % length; categories.splice(index, 1); categories.splice(insertindex, 0, category); $categories.trigger("create"); } here's version of moveup swap in 1 step: moveup: function(category) { var = categories.indexof(category); if (i >= 1) { var array = categories(); categories.splice(i-1, 2, array[i], array[i-1]); } } that still ...

regex to select text between 2 string? -

regex to select text between 2 string? - i've next string month: march 2011 month: jan 2012 month: dec 2011 and i'd write regex select name of month (ie "march") 2011. mean select between string "month: " , year "2011". regex made ^(month:)[a-za-z0-9]+(2011)$ but doesn't seem work. what's wrong??? results should "march" , "december". thanks! use lookahead: /[a-z]+(?= 2011)/ig see here in action: http://regex101.com/r/fe9lr9 here's javascript demo: http://jsfiddle.net/rzjur/ regex

python - Django-Axes causing DatabaseError - Transaction Block -

python - Django-Axes causing DatabaseError - Transaction Block - so i've updated django 1.4.5 , postgres 9.2.3 , psycopg2 2.4.6 . runserver , looks ok, when go localhost:8000 see infamous 'current transaction aborted..' on request.session.save() in sessions/middleware.py(36). i ran syncdb , migrate , no errors or changes matter. added in 'databases' - 'options': {'autocommit': true, }, still no help. , tried this: from django.db import connection connection._rollback() in django shell. i tried stop postgres with: pg_ctl -d /usr/local/var/postgres stop -s -m fast and get: pg_ctl: server not shut downwards running pg -ef|grep postgres shows no hanging queries. how can resolve block? how find causes it? answer: a summery of did solve error i enabled sql logging: debug=true logging = { 'version': 1, 'disable_existing_loggers': false, 'handlers': { ...

c# - Find the top summed values and take 3 -

c# - Find the top summed values and take 3 - i have code (not sure if works can't test it): var test = base.unitofwork.session.query<nutritionfact>() .where(x => x.nutritionalserving.id == servingid) .groupby(x => x.userverifiedfacts) .orderbydescending(x => x.sum(e => e.userverifiedfacts.count())) .take(3) .select(r => new { c = r.key, sum = r.sum(x => x.userverifiedfacts.count()) }) .tolist(); what trying find nutritionfacts have right servingid . want count each of nutritionfacts found count of how many users verified information. want top 3 results , utilize them. what doing resul...

ios - Finding the cause of memory leak in Instruments -

ios - Finding the cause of memory leak in Instruments - i have run leaks in instruments , showing me memory leak 100% value. able see line of code causing problem. not sure error is.. - (void) listallbooks { if (marrlistfromdb != nil) { [marrlistfromdb removeallobjects]; marrlistfromdb = nil; } marrlistfromdb = [[nsmutablearray alloc] init]; servercommunicationapi *servapi = [[servercommunicationapi alloc] init]; servapi.delegate = self; nsurl *url = [nsurl urlwithstring:klistcontents]; [servapi listbookswithdeviceid:singleton.g_strdevid devicekey:singleton.g_strdevid andsessionstring:singleton.g_strsessionid sessionkey:@"sessionkey" url:url andrequestmethod:@"post"]; } the line of error lastly one. not sure why causing memory leak... need guidance.. it hard tell info provided, maybe delegate property of servercommunicationapi declared (strong) ? in case servapi never released, because keeps strong ...

ios - Does iPhone Simulator emulate memory ram space of different devices? -

ios - Does iPhone Simulator emulate memory ram space of different devices? - i need test app on iphone 3gs haven't real device. app contains several functions requires big amount of utilize of cpu. if test app on simulator setting device hardware "iphone", emulate real memory space of iphone 3gs? can rely in iphone simulator? no. simulator not unconstrained , has cpu/memory of computer. some more interesting differences here: iphone device vs. iphone simulator iphone ios xcode ios-simulator

perl - push not appending to the end of the array -

perl - push not appending to the end of the array - db<2> n main::(/home/repsa/temper.pl:84): $tttdiskhumber=$mytemprecord[-1]; db<2> n main::(/home/repsa/temper.pl:87): push(@mymainrecord,$tttdiskhumber); db<2> p @mymainrecord t2agvio701vhost03t2adsap7011 db<3> p $tttdiskhumber hdisk6 db<4> n main::(/home/repsa/temper.pl:88): @mytemprecord=(); db<4> p @mymainrecord hdisk6o701vhost03t2adsap7011 db<5> why lastly force not appending end of array? help appreciated.... oh is. problem you're sending carriage homecoming screen. it's trailing previous element in array. $ perl -e'print "abc", "def\r", "ghi", "\n";' ghidef you read windows text file on non-windows scheme without convert line endings, either in advance (using dos2unix ) or when read file (by using s/\s+\z//; instead of chomp; ). as jordanm suggested in comment, d...

Executing functions in a loop in javascript -

Executing functions in a loop in javascript - i'm missing in java script. i'd execute same function different parameters sequentially in loop (like in commented part of code). i'm instead using callback, guess it's not nicest way, , not flexible, illustration if had more paths looped over. cleanest approach in sewuentially executing functions? var info = ''; var filepath = ['path1', 'path2']; somefunction(filepath, callback) { //dosth (); callback(); } //filepath = ['path1', 'path2']; //for ( var = 0; < filepath.length; = + 1 ) { // somefunction( filepath[i] ); //} somefunction( filepath[0] , function() { console.log("finished processing file 1"); countfromfile( filepath[1], function() { console.log("finished processing file 2"); savetofile( info ); }); }); use async create foreach asynchronous function. example: filepath = ['path1...

android - How to set progress drawable of VerticalSeekBar? -

android - How to set progress drawable of VerticalSeekBar? - i used verticalseekbar descripted on how can working vertical seekbar in android?. it's pretty job , works me. when set progressdrawable in layout xml, doesnot work. suggestions? here snippet in layout xml: <com.aidufei.widget.verticalseekbar android:id="@+id/volume_bar" android:layout_width="16dip" android:layout_height="160dip" android:background="@drawable/volume_bar_bg" android:paddingbottom="20dip" android:progressdrawable="@drawable/vol_seekbar_style" android:thumb="@drawable/volume_thumb" android:thumboffset="-13dip" /> and vol_seekbar_style.xml:` <item android:id="@android:id/background"> <shape> <corners android:radius="5dip" /> <gradient android:angle="360" android:centercolor="#868781" android:c...

R model fitting routine fails to run in a function -

R model fitting routine fails to run in a function - i'm using firth , turner's bradleyterry2 bundle paired comparisons have run mysterious problem using main fitting function btm. here minimal info setup own example: data(citations, bundle = "bradleyterry2") citations.sf <- countstobinomial(citations) names(citations.sf)[1:2] <- c("journal1", "journal2") so @ console next works: citemodel <- btm(cbind(win1, win2), journal1, journal2, info = citations.sf) but next not work f1 <- function(x){ btm(cbind(win1, win2), journal1, journal2, data=x) } f1(citations.sf) while (statistically nonsensical but) structurally similar linear model illustration does work, expect: f2 <- function(x){ lm(log(win1/win2) ~ journal1, data=x) } f2(citations.sf) the error f1 "error in eval(substitute(expr), data, enclos = parent.frame()): invalid 'envir' argument". not telling me can understand. thou...

PHP Value of Variable is undefined -

PHP Value of Variable is undefined - i getting " notice: undefined index:k" in php code. k name of text field , using $_get[] method value of k. in below mentioned illustration trying maintain value available after form submitted. code runs fine first time sec time gives above error. <form name="keywordquery" method="get" action="keywordsearch.php"> <fieldset class="fieldsetclass"><legend class="legendclass">search keywords</legend> <div id="searchbox"> <input type="text" name="k" value="<?php if(isset($_get['k'])){echo htmlentities($_get['k']);} ?>" style="border: 1px, thin; width:92%; "/> <input type="image" style="margin-bottom: 0; margin-top: 2px;" src="search.png" value="submit" /> </div> </fieldset> </for...

arm - FreeRTOS stack corruption on STM32F4 with gcc -

arm - FreeRTOS stack corruption on STM32F4 with gcc - i'm trying freertos running on stm32f4discovery board. have installed summon-arm-toolchain , created makefile compile code. here makefile: toolchain_path:=/usr/local/sat/bin toolchain_prefix:=arm-none-eabi optlvl:=0 freertos:=.. startup:=$(curdir)/startup linker_script:=$(freertos)/utilities/stm32_flash.ld include=-i$(curdir) # setting other include path... build_dir = $(curdir)/build bin_dir = $(curdir)/binary vpath %.c $(curdir) # setting other vpath... vpath %.s $(startup) asrc=startup_stm32f4xx.s # project source files src+=stm32f4xx_it.c src+=system_stm32f4xx.c src+=main.c # freertos source files src+=port.c src+=list.c src+=queue.c src+=tasks.c src+=timers.c src+=heap_2.c src+=syscalls.c src+=stm32f4xx_usart.c # other peripheral source files... cdefs=-duse_stdperiph_driver cdefs+=-dstm32f4xx cdefs+=-dhse_value=8000000 mcuflags=-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp commonflags=-o$(optlvl) -g ...

ios - Background video playing of MPMoviePlayer issue -

ios - Background video playing of MPMoviePlayer issue - hello using mpmovieplayercontroller play live streaming , cached videos in application.when video playing , press home button ,it pauses. set background mode -audio in info.plist. when application goes background pauses video, user has go ipodplayer in multitasking panel , nail play continue. not getting problem,can help me in this? use [[avaudiosession sharedinstance] setdelegate: self]; [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback error:nil]; [[avaudiosession sharedinstance] setactive: yes error: nil]; but still not working. ios ios5 video ios6 mpmovieplayercontroller

c++ - Which initialization of a static variable is correct -

c++ - Which initialization of a static variable is correct - i have static variable in header. example: header file: class fruits{ public: static int colour; } at cpp file after including header, improve write: int fruits::colour=1; or int fruits::colour(1); someone told me first not initialization of variable declaration of another. right way , place set initialization? when c++ beingness designed decided that, maintain consistency before code, type x = y; considered equivalent type x(y); for built-in types. 2 examples of static initialisation give hence treated utterly identical compiler , different ways of writing same thing. for classes, becomes more complicated. in many cases, type x = y , type x(y) interchangeable, however, there circumstances in result in different results. discussed, @ length, in answers this question. c++

c# - Can not change value in textbox when edit -

c# - Can not change value in textbox when edit - in page-load method set value textbox this txtid.value = pro.getid().tostring(); txtmodel.text = pro.getmodal(); txtname.text = pro.getname(); cbcategory.selectedvalue = pro.getcategory(); txtprice.text = pro.getprice().tostring(); txtdescription.text = pro.getdescription(); and when submit edit product value string id = txtid.value.tostring(); string modal = txtmodel.text.tostring(); int category = int.parse(cbcategory.selectedvalue); string name = txtname.text.tostring(); string description = txtdescription.text.tostring(); and seek alter value different original when bug it's still maintain original value , save database. where setting these values on page load may reason. set within if (!page.ispostback) follows if (!page.ispostback) { txtid.value = pro.getid().tostring(); txtmodel.text = pro.getmodal(); txtname.text = pro.getname(); cbcategory.selectedvalue = pro.getcategory...

iphone - Default fetchrequest result order changed every time -

iphone - Default fetchrequest result order changed every time - i executedfetchrequest entity @"tanid" contiains 5 records 1,2,3,4,5 --> problem first time shows 2,3,4,5,1 --> if 1 time again running shows 4,2,1,3,5 super dooper any 1 tell how rectify problem. you can utilize nssortdescriptor sort nsfetchrequest. otherwise, order not guaranteed. there examples in fetching managed objects section of core info programming guide. nssortdescriptor *sortdescriptor = [[nssortdescriptor alloc] initwithkey:@"firstname" ascending:yes]; [request setsortdescriptors:@[sortdescriptor]]; iphone objective-c iphonecoredatarecipes

javascript - Handle many IDs -

javascript - Handle many IDs - i making character counter input fields in form. script, when focus on input field, when leave it, , when finish pressing key: $(document).ready(function () { $("#in1").keyup(function () { $("#count1").text(50 - this.value.length); }); $("#in1").focus(function () { $("#countainer1").show(); $("#count1").text(50 - this.value.length); }); $("#in1").blur(function () { $("#countainer1").hide(); }); }); you can see working here: http://jsfiddle.net/uqfd6/12/ the question is: do have generate script each id? i mean, code same, applied different ids: #input1 shows #countainer1 , modifies #count1 , #input2 #countainer2 , #count2 , , on. i thought of using classes instead of ids, when shows container, show every container of class, instead of 1 field i'm writing in. no, can utilize class instead of #in1 , ...

eclipse - How to Debug the code located remotely -

eclipse - How to Debug the code located remotely - i working on web application . using eclipse , jetty 7 web server application . create changes code , deploy linux machine remotely located . after deployment access application through browser using http://10.56.345:8080/mviewer question , possible debug in case ?? please share views . thanks in advance . you can utilize remote debugger in eclispe. can set using proper connection parameters in eclipse remote debug configuration eclipse jetty

jQuery ready() issues - $(this) not usable and code applies only to one element -

jQuery ready() issues - $(this) not usable and code applies only to one element - im having issues getting jquery run when dom ready. i have 2 forms, each <select> when code runs should load in other form elements. when user first loads page, want these selects on ready() grab attributes (form action, load() target etc) , load in. works fine when using change() , can 1 <select> work when not both. html class="lang-html prettyprint-override"> <form action="php/bagcreate/newbag_bag.php" method="post" id="form1"> <select id="target" data-target="upform" class="get" name="baglevel"> <option>1</option> <option>2</option> <option>3</option> </select> </form> <form action="php/bagcreate/storeitems_bag.php" method="post" id="form2"> <select id=...

gwt - Something other than a Java object was returned from JSNI method -

gwt - Something other than a Java object was returned from JSNI method - when running errai-mvp-demo sample application via mvn gwt:run i error: java.lang.illegalargumentexception: other java object returned jsni method '@com.google.gwt.core.client.impl.impl::apply(ljava/lang/object;ljava/lang/object;ljava/lang/object;)': js value of type boolean, expected java.lang.object @ com.google.gwt.dev.shell.jsvalueglue.get(jsvalueglue.java:178) @ com.google.gwt.dev.shell.modulespace.invokenativeobject(modulespace.java:271) @ com.google.gwt.dev.shell.javascripthost.invokenativeobject(javascripthost.java:91) @ com.google.gwt.core.client.impl.impl.apply(impl.java) @ com.google.gwt.core.client.impl.impl.entry0(impl.java:213) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmetho...

shell - How to fetchmail into specified folder? -

shell - How to fetchmail into specified folder? - i installed fetchmail. debian@debian:~$ fetchmail -p pop3 -u myaccount pop.163.com enter password myaccount@pop.163.com: 2 messages myaccount @ pop.163.com (23852 octets). reading message myaccount@pop3.163.idns.yeah.net:1 of 2 (10814 octets) flushed reading message myaccount@pop3.163.idns.yeah.net:2 of 2 (13038 octets) flushed where mail? how can download /tmp? by default, fetchmail deliver local smtp server. in configuration need decide mailbox stored. shell

javascript - IIS: Images, CSS and Scripts missing -

javascript - IIS: Images, CSS and Scripts missing - i publish site using iis, got error cannot read configuration file due insufficient permissions . tried adding permissions iis_usrs, computer (win7) not have user. right clicked on folder > security tab > edit > advanced , searched user not present. i editted basic settings of application in iis , connected specific user. worked fine did not error message cannot read configuration file due insufficient permissions . page displayed no style. css, image , javascripst files not loaded. tried browing images setting each of paths in url. images exist able browse, not load page. i opened controll panel > programs , featured > turn owindows features on or off > net info services > www services > mutual http featured , checked static content. did not solve issue. why this? how can prepare please? if using iis7 or 7.5: open iis manager > take site > iis panel > authentication > an...

javascript - white space at the bottom of page -

javascript - white space at the bottom of page - the problem have site keeps giving big white space on bottom of page, thought why happening? i have css on content: #content{ width: 990px; margin: 0 auto; min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -40px; position: relative; } .full-background { z-index: -999; min-height: 100%; min-width: 1024px; width: 100%; height: 100%; position: fixed; top: 0; left: 0; } and i´m using script fit background image window: function fittobox(){ $('.fittobox').each(function(){ $(this).fittobox(); }) } $(window).bind({ 'load' : fittobox, 'resize' : fittobox }) update function // fittobox jquery.fn.fittobox = function(){ var div = this.parent(); var img = this;...

Random actions in JAVA -

Random actions in JAVA - i'm writing first own chess game in java. code works 2 players, manually playing keyboard, , expand player against computer game. my problem is, i've never dealt random actions. method moving piece on board, needs recieve 4 inputs: 2 ints piece location, , 2 ints destination on board. choosing wrong inputs ok since movepiece method checks if ints not out of board's bounds, reach piece of current player's color, there's piece in coordination , not empty, etc. but how these 4 ints randomly? , how create them closest possible "real" inputs (so dont spend alot of time disqualifying bad inputs) ? thanks alot :d java provides @ to the lowest degree 2 options generate random values: http://docs.oracle.com/javase/6/docs/api/java/util/random.html http://docs.oracle.com/javase/6/docs/api/java/lang/math.html#random() e.g. random int values bounded 4: int x = new random().nextint(4); int y = (int) (math.random() * ...

flash media server - NetConnection failed -

flash media server - NetConnection failed - i downloaded adobe media server starter 5.0. unable connect fms using rtmfp. maintain receiving netconnection.connect.failed error. when run locally things appear working fine. i have checked ports 80, 443, , 1935 , open. how should diagnose this. mutual causes of problem? thank you. flash-media-server netconnection

Python/Django - cannot import my own models.py -

Python/Django - cannot import my own models.py - this ridiculous. folders: evista --manage.py --evista ----__init__.py ----settings.py ----urls.py ----wsgi.py --fms ----__init__.py ----models.py ----tests.py ----views.py ----features ------__init__.py ------funding.feature ------funding.py in funding.py have from fms.models import * when run lettuce get: importerror: no module named fms.models gonna have shoot myself. just laughs set re-create of models.py in features folder , from models import * results in importerror: settings cannot imported, because environment variable django_se ttings_module undefined. in manage.py have if __name__ == "__main__": os.environ.setdefault("django_settings_module", "evista.settings") i seem in business with: from fms.models import * seems don't run lettuce django, have run: python manage.py harvest from top folder contains manage.py of course. ...

How can we use multiple Ids/content in a single selector in JQuery -

How can we use multiple Ids/content in a single selector in JQuery - please suggest me proper jquery selector this. how optimise this?please suggest $("#name").keyup(function (event) { if (event.keycode == 13) { $("#search").click(); } }); $("#username").keyup(function (event) { if (event.keycode == 13) { $("#search").click(); } }); please replace code following. $("#name,#username").keyup(function (event) { if (event.keycode == 13) { $("#search").click(); } }); jquery jquery-selectors

html - Fixing center alignment with negative margin-left trick for small window -

html - Fixing center alignment with negative margin-left trick for small window - i have div center-aligned way: <div id="container" style="position:absolute; top:0px; left:50%; margin-left:-500px; width:1000px;"></div> as solution trying center div horizontally , vertically in screen suggest. the problem if client's window's width (tried in ff 15.0.1) smaller 1000px horizontal scrollbar won't allow show left side of div. is there pure html/css way solve it? hmm. can not resize client window. 1 thing can avoid left scroll setting width of parent div 1000px <div id="parent" style="min-width:1000px;"> <div id="container" style="position:absolute; top:0px; left:50%; margin-left:-500px; width:1000px;"></div> </div> note: might have set width of html , body tag min-width=100% updated: <html style="min-width: 100%; backg...

vb.net - Make error window -

vb.net - Make error window - i want create edition error study form instead default error window. how can create edition form error report? for example: so want phone call custom handler when exception happens? no problem, define these 3 magic lines in origin of programme (as first lines of sub main ): addhandler application.threadexception, addressof generichandler application.setunhandledexceptionmode(unhandledexceptionmode.catchexception) addhandler appdomain.currentdomain.unhandledexception, addressof unhandledhandler then define generichandler , unhandledhandler, phone call custom form. here sample implementation of both handlers: public shared sub generichandler(byval sender object, byval args threading.threadexceptioneventargs) reportexception(args.exception) end sub public shared sub unhandledhandler(byval sender object, byval args unhandledexceptioneventargs) if not debugger.isattached reportexception(args.exceptionobject) end end i...

javascript - How to use CSS styles with Google Apps table (grid) -

javascript - How to use CSS styles with Google Apps table (grid) - i'm beginner looking help styling table produced google apps script, it's table displays list of google contacts, , started code this site. i've been trying style adding .setstyleattributes({}) app.creategrid , grid.setwidget , app.createlabel can't seem find way target <td> elements on browsers. current page looks ok in chrome can't border collapse in firefox... what able to: have borders collapsing on firefox (done thanks) style cell borders horizontal bluish lines , no verticals (or white verticals) anyway, here code producing table, suggestions or help appreciated. //create grid hold contacts data, styles set <table> inline styles var grid = app.creategrid(sorted_contacts.length+1,6) .setborderwidth(1) .setcellpadding(5) .setstyleattributes({bordercollapse: "collapse", border: "1px solid #d1e2ff", borderbottom: "1px solid #d1e2ff...

java - Adding a JMenu to a JPanel -

java - Adding a JMenu to a JPanel - i need have jmenu (the 1 arrow on right can display jmenuitem ) in jpanel . problem when jmenu not activate on mouse rollover... don't know how , if it's possible. if wrap jmenu in jmenubar , works expected. here demo example: import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jmenu; import javax.swing.jmenubar; import javax.swing.jmenuitem; import javax.swing.joptionpane; import javax.swing.swingutilities; public class testmenus { private jmenubar createmenubar(string name, int depth) { jmenubar bar = new jmenubar(); bar.add(createmenu(name, depth)); homecoming bar; } private jmenu createmenu(string name, int depth) { jmenu menu = new jmenu(name); (int = 0; < 5; i++) { if (depth > 0) { menu.add(createmenu("sub-" + name, depth - 1)); } }...

Python syntax for an empty while loop -

Python syntax for an empty while loop - i have written this: while file.readline().startswith("#"): go on but suspect continue unnecessary? right syntax i'm trying achieve? while file.readline().startswith("#"): pass this uses pass statement : the pass statement nothing. can used when statement required syntactically programme requires no action. http://www.network-theory.co.uk/docs/pytut/passstatements.html python while-loop

pointers - Void array, dynamic size variables in C -

pointers - Void array, dynamic size variables in C - alright i'll seek explain problem clearly. i have function sort array of anything, based on size of element , on offset , size of the variable in element (for utilize structures). so function like: void sort(void* array, size_t elem_size, int elem_count, size_t operand_offset, size_t operand_size) array pointer origin of array elem_size size of 1 element in array elem_count count of elements in array operand_offset offset of variable within element base of operations sort on (it 0 if element 1 variable, more if element struct) operand_size size of variable in function need create temp variable, that: void* temp = malloc(elem_size); *temp = *(array+ i*elem_size); but compiler doesn't agree: dereferencing void* pointer, , doesn't know size of temp variable... i know byte per byte, know if there improve way. so question is: how set "size" of pointer elem_size ? aditional qu...

excel - Play a sound with VBA if an error is found -

excel - Play a sound with VBA if an error is found - i have code: option explicit private declare function sndplaysound32 lib "winmm.dll" _ alias "sndplaysounda" (byval lpszsoundname _ string, byval uflags long) long private sub worksheet_change(byval target range) dim cell range dim checkrange range dim playsound boolean set checkrange = range("c:c") each cell in checkrange if cell.value = "#n/a" playsound = true end if next if playsound phone call sndplaysound32("c:\windows\media\chord.wav", 1) end if end sub i trying if there error in column c, audible sound played, not work, ideas? you don't need api this you can utilize beep well. sub sample() beep end sub example way 1 this code run if there alter anywhere in sheet option explicit private sub worksheet_change(byval target range) dim cell range dim ...

asp.net - Intuit Partner Platform (IPP) QuickBooks Online (QBO) BlueDot Menu ASPX page not rendering in Internet Explorer (IE) -

asp.net - Intuit Partner Platform (IPP) QuickBooks Online (QBO) BlueDot Menu ASPX page not rendering in Internet Explorer (IE) - i have .aspx page display either bluedot or connecttoquickbooks buttons. resultant html looks this, collected ie page: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>truecommerce intuit connect page</title> <script type="text/javascript" src="https://appcenter.intuit.com/content/ia/intuit.ipp.anywhere.js"></script> <script type="text/javascript"> intuit.ipp.anywhere.setup({ menuproxy: 'http://localhost:1384/menuproxy.aspx', granturl: 'http://localhost:1384...

tfs2010 - Migration from TFS 2010 to TFS 2012 -

tfs2010 - Migration from TFS 2010 to TFS 2012 - i have been searching web clean solution on how migrate our 2010 tfs collections our new tfs 2012 server, no luck. may please assist steps or blog @ accomplish process. reason want migration , not upgrade because got new hardware , first trial tfs 2012 before upgrade our live environment. hence import our collection including work items , build process templates. you can move collection @ time using detach alternative in 2010 , attach 2012 using attach alternative there. see http://msdn.microsoft.com/en-us/library/dd936138(v=vs.100).aspx tfs tfs2010 hardware tfs2012 tfs-migration

.htaccess - how to change domain name? -

.htaccess - how to change domain name? - i have domain name alfared.in.ua/public (zf2),but want alter domain name alfared.in.ua?how this? .htaccess rewriteengine on rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l] httpd-vhosts.conf <virtualhost alfared.in.ua:80> documentroot "c:\xampp/htdocs/alfared.in.ua/www/module/application/view/layout/" servername alfared.in.ua setenv application_env "development" <directory "c:/xampp/htdocs/zf2/public"> directoryindex index.php allowoverride order allow,deny allow </directory> </virtualhost> can seek modify httpd.vhosts.conf to <virtualhost alfared.in.ua:80> documentroot "c:/xampp/htdocs/zf2/public" servername alfared.in.ua setenv application_env "development" <directo...

web - WordPress local site is repeating domain and breaking -

web - WordPress local site is repeating domain and breaking - i double checked db. site keeps trying pull localhost/foo/localhost/foo localhost/foo does happen when login localhost/foo/wp-login.php ? if yes go options table , update both siteurl , home http://localhost/foo wordpress web localhost mamp web-deployment

Writing from a large list to a text file in Python -

Writing from a large list to a text file in Python - something unusual happens when seek write ordinary list, containing 648470 string-values, text file. textfile = open('bins.txt', 'w') item in biglist: print item # prints fine textfile.write(item) textfile.close() the text file grows rapidly in file size , filled kind of symbols, not intended ones... if write little span of content of biglist text file gets corrupted. if exact same thing much smaller list, there's no problem. big size of list causing problem? output of print(biglist[:10]) is ['167', '14444', '118', '22110', '118', '8134', '82', '8949', '7875', '171'] it works absolutely fine me. in code forgetting close file, , also, since open file in append mode, guess have garbage in file there , forgot remove. also, maintain in mind write in way not separate numbers in w...

Is it possible to use MacPorts with ONLY Xcode 4.3 CLI tools installed? -

Is it possible to use MacPorts with ONLY Xcode 4.3 CLI tools installed? - i understand starting xcode 4.3 cli tools separate installation , caused many issues existing macports installations upon upgrade. question not problem. brand new rmbp 15.4", attempted install only cli tools via download apple developer site. not did macports fail find xcode, xcodebuilder failed execute (simply hangs...). tried many iterations of using xcode-select point cli binaries, couldn't either macports or cli binaries work. is not possible install (the wonderfully tidy , ssd-friendly) cli tools , macports work? not able find confirmed or denied in several searches here , on google in general. 128gb ssd, every gb counts... , 4+gb xcode install (99% of don't need) waste of space. there in proper xcode install macports requires? xcode macports

railstutorial.org - rails tutorial: bundle exec rspec not found -

railstutorial.org - rails tutorial: bundle exec rspec not found - i returning rails after time away , amazed of production/development back upwards has been added. i'm doing hartl tutorial seek larn new features, , i've run problem chapter 3. in short, bundle exec rspec spec gives me this: bundler: command not found: rspec install missing gem executables `bundle install` however, if bundle install --binstubs=bin , bin/rspec spec works fine. fine, thought. i'll run stub, i'm running problems when seek set guard, same thing. fails bundle exec guard , bin/guard works fine. except bin/guard doesn't quite work fine. runs, error: 00:45:00 - info - guard::rspec running, rspec 2! 00:45:00 - info - running specs bin/guard: no such file or directory - bundle exec rspec --help 00:45:00 - info - guard::rspec running, rspec 2! 00:45:00 - info - running specs bin/guard: no such file or directory - bundle exec rspec --help 00:45:00 - info - guard watch...

ios - UITableView issue in iPad? -

ios - UITableView issue in iPad? - i working in ipad application. i'm using uitableview create table , insert 2 uiimageview s in each cell. tried set image in both uiimageview s, index path values start 0,1,2,3,4 etc... each uiimageview has same image in first cell. how prepare issue? example: - (void)viewdidload { [super viewdidload]; // imagearray have 5images; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { homecoming [imagearray count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; imgview1.image = [imagearray objectatindex:indexpath.row]; imgview2.image = [imagearray objectatindex:indexpath.row]; } after formatting code becomes clear assigning same image array each of 2 imag...

osx - How to install pip? -

osx - How to install pip? - i trying install pip in lion 10.7. typing sudo easy_install pip i next message: searching pip best match: pip 1.2.1 processing pip-1.2.1-py2.7.egg pip 1.2.1 active version in easy-install.pth installing pip script /usr/local/bin error: /usr/local/bin/pip: no such file or directory i checked path in /usr/../bin/ , ther exists pip directory. how can prepare this? osx pip

angularjs - .get() Url is not what i expect -

angularjs - .get() Url is not what i expect - i'm trying angular.js first time. have rest service configured next way: get('/api/users') //returns json array users get('/api/users/:id') //returns json object requested id my angular controller set this: userctrl.factory('user', function($resource) { homecoming $resource('/api/users/:id', { id: '@id' }, { update: { method: 'put' } }); }); var editctrl = function($scope, $location, $routeparams, user){ var id = $routeparams._id; $scope.user = user.get({id: id}); }; my problem when run user.get({id: id}) the url requested is: http://localhost:8080/api/users?id=389498473294 i want http://localhost:8080/api/users/389498473294 i can using $http , think .get() should able it... thanks you define default value id parameter prefixed @, means value must taken object passed parameter call. in phone call there no object sent, id paramet...

JSON / PHP : Json_encode with [ ] -

JSON / PHP : Json_encode with [ ] - i write request in php, don't know how translate [,] in php request : json : { "output": "extend", "filter": { "host": [ "zabbix server", "linux server" ] } } php : array( 'output' => 'extend', 'filter' => array ( 'host' => ??? "zabbix server", "linux server" ??? ) ) can please help me ? give thanks in advance. do not reinwent wheel. utilize json_decode() job: http://www.php.net/manual/en/function.json-decode.php php json

datetime - MySQL - convert timed event rows to ranges of states -

datetime - MySQL - convert timed event rows to ranges of states - let's house gets painted every often, , track changes (the 'paint' event) in simple table: _______________________ / paintdate | newcolor \ |-----------|-----------| | 1/2/2012 | reddish | | 3/5/2013 | bluish | | 9/9/2013 | greenish | \___________|___________/ is there select statement can give me table of the date ranges house @ specific color? desired output: _______________________________ / | | color \ |----------|----------|---------| | 1/2/2012 | 3/5/2013 | reddish | | 3/5/2013 | 9/9/2013 | bluish | | 9/9/2013 | null | greenish | -- not repainted yet, date in 'to' column should null \__________|__________|_________/ well can utilize query select p.paintdate `from`, l.paintdate `to`, p.newcolor `color` paint p left bring together (select * paint limit 1, 18446744073709551615) l on l.paintdate...

multithreading - proper threading in python -

multithreading - proper threading in python - i writing home automation helpers - little daemon-like python applications. can run each separate process since there made decided set little dispatcher spawn each of daemons in own threads , able deed shall thread die in future. this looks (working 2 classes): from daemons import mosquitto_daemon, gtalk_daemon threading import thread print('starting daemons') mq_client = mosquitto_daemon.client() gt_client = gtalk_daemon.client() print('starting mq') mq = thread(target=mq_client.run) mq.start() print('starting gt') gt = thread(target=gt_client.run) gt.start() while mq.isalive() , gt.isalive(): pass print('something died') the problem mq daemon (moquitto) work fine shall run directly: mq_client = mosquitto_daemon.client() mq_client.run() it start , hang in there listening messages nail relevant topics - i'm looking for. however, run within dispatcher makes deed weirdly ...

ios - How to find out when UILabel wordwraps -

ios - How to find out when UILabel wordwraps - i have created couple of different uitableviewcell s tableviewcontroller , because have different bits of info want display depending comes back. because of each uitableviewcell of different height. this fine, 1 of uilabel s has display big nsstring , big have had word wrap onto sec line, issue here messes uitableviewcell formatting. my question is, possible flag or capture type of action when uilabel receiving nsstring has utilize wordrap because size of nsstring long? or there way calculate physical length (not how many chars in string) of nsstring can decide hey need reformat uitableviewcell .. any help appreciated. the usual way utilize sizewithfont:constrainedtosize:linebreakmode: size of string. utilize this: cgsize stringsize = [thestring sizewithfont:[uifont fontwithname:@"helvetica neue" size:12] constrainedtosize:cgsizemake(320, 3000) linebreakmode:nslinebreakbywordwrapping ]; thi...

c# - Is it possible to ignore a column mapping contitionally in code first Entity Framework? -

c# - Is it possible to ignore a column mapping contitionally in code first Entity Framework? - i using entity framework connect 2 databases same schema. generated code first classes database of tables , columns. wondering if there way homecoming null column may missing (and not mapping error) , homecoming value database still has column? don't want ignore mapping property because want value database still has column. c# entity-framework-5

Set NTP server in windows7 but dynamic ip -

Set NTP server in windows7 but dynamic ip - i seek set ntp server in windows7. on client side usual need set server's ip. the problem server side have different ip everyweek suppose. any 1 can throw me bone here? good ntp servive: pool.ntp.org. choosing pool.ntp.org ntp host automatically select performing server. read more @ same address (pool.ntp.org). set lite on problem since site gets different ips every , then. ntp

mysql - Phone Number Conversion and Comparison -

mysql - Phone Number Conversion and Comparison - i have 2 columns compare: first column residential number appears in format of (555) 555-5555, sec column appears in format of 5555555555.00. compare first 6 digits of each number in 3rd column displaying true if first 6 digits match , false if not. have query done, converting columns in same format killing me. help on this? in mysql, quick solution this: select col1, col2, case when left( replace(replace(replace(replace(col1, '(', ''), ')', ''), '-', ''), ' ', ''), 6) = left(col2,6) 'true' else 'false' end matches yourtable please see fiddle. mysql .net vb.net datagridview