Posts

Showing posts from March, 2012

<Base> link with port number for HTML -

i'm facing following: i set dynamic dns connection home , forwarded port number 80xx nas's 80 port, can access remote. when fill login form , try login, points address without port number, have manually modify address in browser bar re-add port number. the form set this: <form action="/" method="post" name="login" id="login"> how can modify page in order working remote, as local (accessed on standard port 80), without need manually modify address? early in "develop-life", heard <base> i'm not sure on how using page working in both configurations . thanks as per comment if action attribute doesn't specify origin browser should assume origin page requested on scenario describe should not happening. sure port not being specified somewhere else. response posting form issuing 302 redirect location header specifies port? for others readers - setting port number in form act

How to implement multiple user profiles in ASP.NET Identity? -

in project (a simple job board), i'd create types of user such admin, employer, seeker . known implement role management this, want implement different profile each type. example, employer (companyname, companylogo,...) , seeker (name, experience,...) in current solution, created employerprofile , seekerprofile foreign key userid in relationship aspnetusers table. i don't know how solution, suggestion situation? thank you

unity3d - Unity2d vertical movement logical error -

so, code horizontal movement alright , worked perfectly. problem added code vertical movement , keys pretty doing opposite of want accomplish. my right key makes character go up, key makes character go right etc. any appreciated. using unityengine; using system.collections; public class charactermovement : monobehaviour { public float maxspeed = 10f; // use initialization void start () { } // update called once per frame void fixedupdate () { float move = input.getaxis ("horizontal"); rigidbody2d.velocity = new vector2 (move * maxspeed, rigidbody2d.velocity.y); float movev = input.getaxis ("vertical"); rigidbody2d.velocity = new vector2 (movev * maxspeed, rigidbody2d.velocity.x); } y vertical co-ordinate refer in horizontal call. need swap .x , .y around. edit: sorry rushed answer, need swap x , why, , swap vector parameters, so: void fixedupdate () { float move = input.getaxis ("vertical"); ri

How get country and city using IP address in PHP -

i trying country , city using ip address in php.my code given below. i got output.any body give solution these issue?i got out put these way ip address:- 127.0.0.1 city:- not define country:- not define <?php /*get user ip address*/ $ip_address=$_server['remote_addr']; /*get user ip address details geoplugin.net*/ $geopluginurl='http://www.geoplugin.net/php.gp?ip='.$ip_address; $addrdetailsarr = unserialize(file_get_contents($geopluginurl)); /*get city name return array*/ $city = $addrdetailsarr['geoplugin_city']; /*get country name return array*/ $country = $addrdetailsarr['geoplugin_countryname']; /*comment out these line see posible details*/ /*echo '<pre>'; print_r($addrdetailsarr); die();*/ if(!$city){ $city='not define'; }if(!$country){ $country='not define'; } echo '<strong>ip address</strong>:- '.$ip_address.'<br/>'; echo '<strong>city&l

python - Removing points inside several polygons -

Image
the data: have co-ordinates of 2 variables a , b of length 100,000 each , have text file containing co-ordinates of several polygons. i remove points of , b inside different polygons. to so, trying use the code answer in stackoverflow 1 point , 1 polygon. the method have chalked out go problem several points , several polygons this: take co-ordinates of first polygon run function 100,000 points of a , b , if inside, append them list, can use later compare original , b perform above 2 steps co-ordinates of second polygon , on... now have 2 problems facing me, don't know how proceed with. the text file containing co-ordinates of polygons looks this: 020241-041200 4 30.83 -3.69 30.82 -3.69 30.82 -3.73 30.83 -3.73

android - How to make sure the user type "@yahoo" or"@gmail" in an edit text? -

This summary is not available. Please click here to view the post.

cocoa - 'NSTextView' does not have a member named 'setString' -

i new cocoa, i want replace content of nstextview. i find function named setstring of nstext, , nstextview inherits nstext. so why error: nstextview' not have member named 'setstring thank you. right now, have use nstextview.inserttext insert text. the actual property string . objective-c generates getter , setter (if not read only) methods can override behaviour. swift has method observers custom behaviour don't need custom getters/setters. assign property directly: let textview = nstextview() textview.string = "text"

mockito - Junit for JiraRestClient create Issue -

i trying write junit test following method creates new jira issue, know how mock jirarestclient or there other way write test this my code public issue createnewissue(basicproject project, basicuser assignee, basicissuetype issuetype, string summary, string description, string parentkey, file attachment) { try { issueinputbuilder issuebuilder = new issueinputbuilder(project, issuetype); issuebuilder.setdescription(description); issuebuilder.setsummary(summary); issuebuilder.setprojectkey(project.getkey()); issuebuilder.setissuetype(issuetype); issuebuilder.setassignee(assignee); if(parentkey != null) { map<string, object> parent = new hashmap<string, object>(); parent.put("key", parentkey); fieldinput parentfield = new fieldinput("parent", new complexissueinputfieldvalue(parent)); issuebuilder.setfieldinput(parentfield); } issueinput issueinput

java - How can Spring instantiate cClasses with private constructors (singleton pattern) and objects from Factories? -

i studying spring core certification , have following doubt related how can spring instantiate classes private constructors (such singleton pattern) or how can instantiate objects factories (that not spring context). for example have following singleton factory: public class accountservicesingleton implements accountservice { private static accountservicesingleton inst = new accountservicesingleton(); private accountservicesingleton() { ... } public static accountservice getinstance() { // ... return inst; } } this singleton factory because build private static object builded private constructor , have public method object. so think problem how can spring build object? depends on fact that constructor private can't in java configuration class @confguration public class applicationconfig{ @bean public accountservicesingleton accountservicesingleton(){ return new accountservicesingleton(); } } because can

ios - How do you pass data from one ViewController to the next with TyphoonStoryboard? -

Image
i've got simplest possible application powered storyboard. we've got uinavigationcontroller , , view controllers , b. a has textfield user supposed type name into. when user touches button, segues b, showing "hi, [name]!" how pass user-entered name b typhoon? with typhoon, presume lets me avoid using -prepareforsegue:sender: , evil di perspective because requires coupling between otherwise totally unrelated view controllers. (e.g. viewcontrollerb.nametodisplay = self.textfield.text; ) a nice feature of typhoon ability use assemblies factory interface mixes static , runtime dependencies, avoiding boilerplate of creating custom factory. feature called runtime arguments . since storyboards being used emit view controllers won't possible use: runtime arguments, storyboard interface has no concept of this. initializer injection, vcs emitted storyboard use initwithcoder something else can create mutable model object in assembly scope typho

language agnostic - Join bits using bitwise operations. Is this even possible? -

what asking if possible join bits in 2 different numbers . a pseudo-code example: bytes=array(0x04, 0x3f); //place bitwise black magic here print 0x043f; another example: bytes=array(0xff, 0xffff); //place bitwise black magic here print 0xffffff; yet example: bytes=array(0x34f3, 0x54fd); //place bitwise black magic here print 0x34f354fd; i want restrict only , bitwise operators ( >> , << , | , ^ , ~ , & ). this should work @ least in php , javascript. is possible in way? if i'm not being clear, please ask doubts in comment. if understand question correctly, should answer in php: $temp = $your_first_value << strlen(dechex($the_length_of_the_second_value_in_hex)) $result = $temp | $your_second_value print dechex($result) update: instead of + use | operator

c# - Razor Hidden multiple properties -

suppose have object obj of type mytipe properties: prop1, prop2....prop1 , next razor view @model mytipe @using(html.beginform()) { @html.textboxfor(m => m.prop1) @html.hiddenfor(m => m.prop2) @html.hiddenfor(m => m.prop3) .............. @html.hidenfor(m => m.propn) <input type="submit/> } there posibility replace hiddenfor lines samethink else you can wrap properties, should hidden in 1 object e.g.: public class someviewmodel { public hiddenmodel hide{get; set;} ... // other properties } public class hiddenmodel { public int prop1 {get; set;} public string prop2 {get; set;} } and in view: @model someviewmodel @using(html.beginform()) { @html.textboxfor(m => m.prop1) @html.hiddenfor(m => m.hide) <input type="submit/> }

sockets - C# Service Receiver Program Crashes -

hi doing socket programming. when data socket, program works program way remain stuck when data come. not understand why happening. "server.receiver" part gets stuck , program crashes. in addition, doesn't prompt error. c# code application.doevents(); string gelenveri = ""; system.net.sockets.udpclient server = new system.net.sockets.udpclient(convert.toint32(port)); ipendpoint sender = new ipendpoint(ipaddress.parse(ip), 0); byte[] data = new byte[1024]; data = server.receive(ref sender); server.close(); gelenveri = (encoding.ascii.getstring(data, 0, data.length)); use ipendpoint(ipaddress.parse(ip), port) instead of ipendpoint(ipaddress.parse(ip), 0)

spring integration - JMS Outbound Gateway response read throttling -

i have jms outbound gateway sends messages out via request queue , receives messages in via response queue. know simplest way apply throttling receive part of messages off response queue. have tried setting poller outbound gateway but, when set it, response messages not consumed @ all. can poller used in outbound gateways purpose of message consumption throttling? if so, how? if not, how can best throttle message response consumption instead? my stack is: o.s.i:spring-integration-java-dsl:1.0.0.rc1 o.s.i:spring-integration-jms:4.0.4.release my integrationgconfig.class: @configuration @enableintegration public class integrationconfig { ... @bean public integrationflow testflow() { return integrationflows .from("test.request.ch") .handle(jms.outboundgateway(connectionfactory) .receivetimeout(45000) .requestdestination("request_queue") .replydestinat

File.length() in Java returns incorrect length -

i have binary file. while run ls -l, has 12 bytes. however, when try find file's length file.length, result 9. hex representation of file (got xxd -p ): 2090887fffd0ffff437ffd0c here code currentbytesread = inputstream.read(buffer, bufferoffset, math.min(1024, filelength - bytesread)); here input file https://www.dropbox.com/s/y508vsy8m2e8s9n/input.txt?dl=0 i using ubuntu 14.04 64 bits from javadoc: returns: the length, in bytes, of file denoted abstract pathname, or 0l if file not exist. operating systems may return 0l pathnames denoting system-dependent entities such devices or pipes.` are sure file path correct?

gorm - How to define custom table mapping by Config.groovy entry in Grails -

i'm developing plugin needs specific index configuration in table mapping. static mapping = { myproperty index:'myproperty_idx' } is way let plugin users decide if want use or not mapping via config.groovy file? i believe can read config variables right mapping block. so line in app consuming plugin's config.groovy grails.myplugin.useindexforfoo = true should allow have configurable domain class, such as class foo { string mystring static mapping = { if (holders.config?.grails?.myplugin?.useindexforfoo) mystring index: "mystring_idx" } } note have used holders rather injecting grailsapplication bean because mapping config static - not know if optimal or not

javascript - Calling jquery function with function(e) parameters from another jquery function -

$("#submitbutton").click(function(e){ e.preventdefault(); if (!$('#formvalidator').data('bootstrapvalidator').isvalid()) $('#formvalidator').bootstrapvalidator('validate'); if (!$('#jobvalidator').data('bootstrapvalidator').isvalid()) $('#jobvalidator').bootstrapvalidator('validate'); if(($('#formvalidator').data('bootstrapvalidator').isvalid()) & ($('#jobvalidator').data('bootstrapvalidator').isvalid())) { var clickbutton = document.getelementbyid("<%=savebutton.clientid %>"); clickbutton.click(); } }); $(document).keypress(function(e) { if(e.which == 13) { $("#submitbutton").click(); } }); i want $(document).keypress(function(e) cap

ios - How to sort UITableView sections -

i have array of objects date inside. need group objects in uitableview date. examle: 0-{10-14; obj1}; 1-{10-14; obj2}; 2-{10-15; obj3}; 3-{10-15; obj4}; i need view on uitableview this 10-14 0-{10-14; obj1}; 1-{10-14; obj2}; 10-15 2-{10-15; obj3}; 3-{10-15; obj4}; to resolve i've done next; i've splited array nsdictationary code: nsmutabledictionary *preresult = [[nsmutabledictionary alloc] init]; (clientmessage *message in array) { nsmutablearray *marray = [preresult objectforkey:message.formatteddate]; if (marray == nil) { marray = [[nsmutablearray alloc] init]; [preresult setobject: marray forkey:message.formatteddate]; } [marray addobject:message]; } and table view shows me want, shows in wrong order; (my array sorted date) know tha can't sort nsdictationary, in case how can sort values in table view? or there way group values without nsdictationary? once you've finished loading dictionary valu

noclassdeffounderror - Security issues after upgrading to Spring 3.2.8 -

i upgraded spring 3.0 spring 3.2.8 , after servlet creating pdf (jasper) crash giving security error messages. my spring config: <security:http auto-config="true"> <security:form-login authentication-success-handler-ref="authsuccesshandler" login-page="/login.faces" login-processing-url="/loginprocess" authentication-failure-url="/login.faces?login_error=1" /> <security:intercept-url pattern="/login.faces" access="is_authenticated_anonymously"/> <security:intercept-url pattern="/resources/images/**" access="is_authenticated_anonymously" /> <security:intercept-url pattern="/resources/css/main.css" access="is_authenticated_anonymously"/> <security:intercept-url pattern="/resources/css/login.css" access="is_authenticated_anonymously"/> <security:intercept-url pattern="/logout.faces&quo

asp.net - using data connection from server explorer in c# -

Image
i use data connections connect sql server 2008 database. search web know how open, close , queries (crud) found nothing. in first time, open connection. stuck because don't know how connection "object" , use in c# code. here begining of code : sqlconnection conn = new sqlconnection(system.configuration.configurationmanager.connectionstrings["connection"].connectionstring); thanks in advance ! you can't use database server manager. instead include database in solution explorer. still need database in server manager in order use in solution explorer. can add solution explorer right clicking on solution explorer , go add -> new item.

c - Bytes not being read in Arduino code -

i trying set time , date of real time clock, having problem reading data type in serial monitor. in code below, asks if want change date, , type "y" , press enter. after that, asks year, , type"14" , press enter, nothing happens. #include <wire.h> const int ds1307 = 0x68; // address of ds1307 see data sheets const char* days[] = {"sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"}; const char* months[] = {"january", "february", "march", "april", "may", "june", "july", "august","september", "october", "november", "december"}; // initializes values: byte second = 0; byte minute = 0; byte hour = 0; byte weekday = 0; byte monthday = 0; byte month = 0; byte year = 0; void setup() { wire.begin(); serial.begin(9600); delay(2000); // delay a

php - Store an image link in MySQL using Navicat Premium -

Image
i'm designing dynamic website joomla , php part handled dreamweaver. i'm using navicat premium build database. one raw (varchar) in database contains images. found having images blobs in database not idea. but, linking image /img/image.php in cell not working. actually i'm using dreamweaver fetch database table result page. please me in- inserting image link cell via navicat premium. any modifications should in dreamweaver after inserting proper link in cell. thanks.! screenshot of result page the problem is, mixing address , image. have several option. let's create image field in database, , when loop through records, check, image field not empty, , if it's not, show image by: <img src="path of image comes here" alt="" /> in case <img src="/images/image.png" alt="" /> with current design of table, somehow need decide, image, or address. because if loop through recordset, ther

c++ - FDFImageIO error when build project with QT+VTK+ITK -

i building project using qt4.8.4+vtk5.10+itk4.6. while got problem had never occured. in first, shows: link error: cannot open "4.lib". never heard "4.lib" , think useless. delete in linker. then: got 30 errors saying: error lnk2001: unresolved external symbol "void __cdecl itk::fdfimageiofactoryregister__private(void)" (?fdfimageiofactoryregister__private@itk@@yaxxz) d:\workplace\neurolab\build\moc_widgetthreedmesh.obj.... i search through file system , cannot find anywhere using fdfimagexxxx. compiled itk twice , try enable/disable module_fdfimageio, not work anyway. so, have got same error? i find error @ last. find source files download had errors. because re-download vtk+itk source code , recompiled them. no error report. but there bug here. when @ lib list in vs20xx, find strange 4.lib. when integrate gdcm module itk, error may report. thing should add gdcm libs full file path program.

c# - Replace Multiple References of a pattern with Regex -

i have string in following form $kl\u#, $as\gehaeuse#, $kl\tol_plus#, $kl\tol_minus# basically string made of following parts $ = delimiter start (some text) # = delimiter end (all of n times) i replace each of these sections meaningful text. therefore need extract these sections, based on text inside each section , replace section result. resulting string should this: 12v, 0603, +20%, -20% the commas , else not contained within section stays is, sections replaced meaningful values. for question: can me regex pattern finds out these sections can replace them? you need use regex.replace method , use matchevaluator delegate decide replacement value should be. the pattern need can $ except # , # . put middle bit in brackets stored separate group in result. \$([^#]+)# the full thing can (up correct appropriate replacement logic): string value = @"$kl\u#, $as\gehaeuse#, $kl\tol_plus#, $kl\tol_minus#"; string result = regex.replace(value,

ruby - paste and use a oauth2 access token -

i have application using ruby , sinatra. want able paste token in format: {"access_token":"token...uwd--of0iknjr8aew3os9zp2rith3fdsf2wk","token_type":"bearer","expires_in":3600,"created":1415727521} into text-area , use it. problem is, pasted token in string format. have tried converting hash , json format ain't working still. here code: post '/tokenize' got_token = params[:token] # pasted token token_hash = json.parse(got_token) #i not sure if did correctly.but producing hash. token = token_hash.to_json # producing token in json format original token pasted. get_contacts(json.parse(token)) # calling function should use token. giving error since not valid oauth token. redirect ("/tokenize/finish") end error: producing error because token not valid oauth token. please tell me how make token valid , usable. you can manually instantiate token class oauth2::accesstoken params ha

java - When bringing Android activities from the stack to the front, how do I refresh (reinitialize) them? So to run onCreate again etc -

if i'm bringing android activities stack front, how refresh them? run oncreate again etc. my code below, in conjunction setting activities in android manifest android:launchmode="singletask" allows me initiate activity if activity not active within stack, if active within stack brought front. how then, if activity brought front refresh oncreate ran again etc. intent intent = new intent(myactivity.this, myactivity.class); intent.addflags(intent.flag_activity_reorder_to_front); startactivity(intent); i think flag_activity_clear_top resolved problem: intent intent = new intent(myactivity.this, myactivity.class); intent.addflags(intent.flag_activity_clear_top); startactivity(intent);

javascript - How to display calculated values in IE9 -

i'm working on online form attendees of conference fill out. each person enters amount of minutes attended session. minutes convert credit hours in form field so: <div class="col3"> <form onsubmit="return false" oninput="document.getelementbyid('mk1').innerhtml = (math.floor((mc06.value/50) * 2) / 2).tofixed(1)"> <input name="mc06" id="mc06" onkeyup="disablefield06()" type="number" min="0" max="50" placeholder="0-75 minutes" step="any" /> </div> <div class="col1"> <output name="mk1" id="mk1">0</output> </form> </div> in case you're wondering, disablefield function disables session same time slot. no problems there. no problems placeholder either, script found here. the hours subject category (mk in case) collected in function when user clicks submit button:

How to dynamically set image in iOS -

i have following code: nsmutablearray *arrayimages = [nsmutablearray arraywithobjects:@"camera.jpg",@"washmachine.jpg",@"mixer.jpg",@"tv.jpg",@"mobile.jpg",@"fridge.jpg",@"frock.jpg",@"shirt.jpg",nil]; for(int i=0; i<_devicepricearray.count;i++){ [_devicearray addobject:arrayimages]; } and in cellforrowatindexpath :- trying set images [(uiimageview *)[cell viewwithtag:201] setimage:[_devicearray[indexpath.row]]; how set images here? it's saying "expected identifier". observe line [(uiimageview *)[cell viewwithtag:201] setimage:[arrayimages[indexpath.row]]; . here use image name. have pass uiimage object here. replace below line [(uiimageview *)[cell viewwithtag:201] setimage:[uiimage imagenamed:arrayimages[indexpath.row]]];

How to close the activity from current fragment and go back to previous activity in android? -

i having multiple activity in android app multiple fragment each activity . fragment of third activity , want close third activity on press. have tried using inside ondetach() function. getactivity().finish(); this closes current activity while opening same activity again, app crashes. finish() final call before activity gets garbage collected. you should either not call @ since there's no real reason so. if want return later, can't. can create new activity. fragments, happens on parent happens on fragment too. if want close specific activity, have keep reference somewhere fragment can access it. preferably wrapped in weakreference won't leak memory.

python - Running bundle command using paramiko -

i trying execute rake task using python's paramiko module. i have following code: ssh_client = paramiko.sshclient() ssh_client.load_system_host_keys() ssh_client.connect(myserver, username="root") ssh_stdin, ssh_stdout, ssh_stderr = ssh_client.exec_command("cd /mnt/app-production/current ; export path=/usr/local/rubies/1.9.2-p320/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games ; bundle exec rake images:load_swatch") print ssh_stdout.read() print ssh_stderr.read() but following output: rake aborted! loaderror: no such file load -- ruby-debug /mnt/app-production/releases/20141113171842/config/application.rb:7:in `<top (required)>' /mnt/app-production/releases/20141113171842/rakefile:5:in `require' /mnt/app-production/releases/20141113171842/rakefile:5:in `<top (required)>' (see full trace running task --trace) what error? , how can execute command successfully? thanks i t

javascript - Required checkbox in html form, using Safari -

i created html form required checkbox, this: <input type="checkbox" required name="terms"> accept terms. if you're using browsers explorer, chrome , firefox, form won't let submit unless check checkbox, if you're using safari can submit if don't check it. what can solve issue? safari not support attribute, need use javascript. add desired functionality explained here : html: <form action="" method="post" id="formid"> name: <input required = "true"/> <br /> <input type="submit" /> </form> javascript: var form = document.getelementbyid('formid'); // form has have id: <form id="formid"> form.novalidate = true; form.addeventlistener('submit', function(event) { // listen form submitting if (!event.target.checkvalidity()) { event.preventdefault(); // dismiss default functionality

how to encode image to base64 in javascript -

in code below i'm fetching .txt file , getting encoded without giving error oi want use same thing , convert image basse 64 // adding attachment function opensavedialog() { var nsifilepicker = components.interfaces.nsifilepicker; var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.init(window, "select file", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filterhtml | nsifilepicker.filterimages); fp.appendfilters(nsifilepicker.filtertext | nsifilepicker.filterall); var rv = fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; var path = "file://" + fp.file.path; readtextfile(path); document.getelementbyid('filename').value = file.leafname; } } // encoding text base64 function readtextfile(filepath) { var rawfile = new xmlhttprequest(); rawfile.open("get", filepath, false); rawfile.onreadystatec

jsp - Does Websphere Commerce 7 support JSTL 1.1 XML in widgets? -

i have made new blank widget , added page. jstl tags work in jsp, trying example <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> <x:set var="test"/> results in unresolvableexception [19/11/14 17:16:45:617 fet] 0000001f logginghelper e /genericjsppageerror.jsp - $requestscope:ec_device org.apache.taglibs.standard.tag.common.xml.unresolvableexception: $requestscope:ec_device @ org.apache.taglibs.standard.tag.common.xml.xpathutil$jstlvariablecontext.notnull(xpathutil.java:377) @ org.apache.taglibs.standard.tag.common.xml.xpathutil$jstlvariablecontext.getvariablevalue(xpathutil.java:322) @ org.apache.taglibs.standard.tag.common.xml.xpathutil$jstlvariablecontext.getvariableorparam(xpathutil.java:241) @ org.apache.taglibs.standard.tag.common.xml.xpathutil.fillvarstack(xpathutil.java:792) @ org.apache.taglibs.standard.tag.common.xml.xpathutil.selectnodes(xpathutil.java:536) @ org.apache.taglibs.st

PHP _COOKIE not set despite it being set in the cookie header -

i can't quite figure out, setting cookie follows in php code. setcookie('remember', $scookie, time()+31557600, '/'); and can see in headers cookie:__utma=144618662.427039340.1410986461.1413382878.1413400525.42; __utmz=144618662.1412022114.19.3.utmcsr=unknown|utmccn=embed|utmcmd=embed; _ga=ga1.2.427039340.1410986461; remember=j%15%1c%009f%f0%0f%e6%24%c9%26%04%a8%3ej8gp%2flxjvo3alczfvo6em5a%3d%3d; phpsessid=pjaso28lsfkt16e9takc3s6q42 but if var_dump($_cookies) is array(4) { '__utma' => string(55) "144618662.427039340.1410986461.1413382878.1413400525.42" '__utmz' => string(66) "144618662.1412022114.19.3.utmcsr=unknown|utmccn=embed|utmcmd=embed" '_ga' => string(26) "ga1.2.427039340.1410986461" 'phpsessid' => string(26) "pjaso28lsfkt16e9takc3s6q42" } other info the domain development one, port non-standard, 8888 instead of 80. domain, commandstation.byl.

c# - DataGridViewCheckBoxColumns of a DataGridView permit multiple Rows checked -

i've datagridview on i've added checkboxcolumn. have datasource, list of object whit set , get; have boolean properties "checked" used checkbox column.. gets data source should boolean states checkboxes in datagridview, when click on checkbox allow 1 checkbox checked @ time. can select multiple rows , set true bounded "checked" properties? public class mydatasource { public mydatasource (){} public boolean checked { get; set; } public string description { get; set; } } i've added datasource grid class system.windows.forms.bindingsource and add cell click event private void my_grd_cellclick(object sender, datagridviewcelleventargs e) { if (e.rowindex < 0) return; var datagridview = (datagridview)sender; var cell = datagridview[0, e.rowindex]; if (cell.value == null) cell.value = false; cell.value = !(bool)cell.value; }

c# - How to reference csproj from kproj -

i playing around vs2015 , asp.net vnext , , got stuck on trying add reference vnext class library (kproj) regular class library (csproj) in same solution. visual studio 2015 shows following error message: "the following projects not supported references". is possible @ add references csproj vnext class libraries? note: kpm command has been replaced dnu. visual studio 2015 preview (as of writing this) comes asp.net 5 stable release beta1. in version there no way reference csproj project asp.net 5 project. however, on development feed of asp.net 5 command kpm wrap introduced support referencing csproj-projects asp.net 5 projects. see github issue #827 in aspnet/kruntime repository , pull request #875 closes issue. here example how use kpm wrap : make sure newest version of kruntime installed (check kvm list command) (i tested version 1.0.0-beta2-10709 ). create asp.net 5 class library project, used name classlibrary1. create "normal&q

dirtyread - how dirty read works in hibernate -

according manning's java persistence hibernate: dirty read occurs if 1 transaction reads changes made transaction has not yet been committed. dangerous, because changes made other transaction may later rolled back, , invalid data may written first transaction. if record retrieved database , there corresponding object been created in persistent state , whatever changes made , first written on persistent object , hence making dirty. now question if other transaction reading same record , whether read record persistent state ie first level cache(which dirty @ moment) or retrieve record database. first level cache not shared across transactions. except in case of extended persistence contexts common pattern used each transaction associated single session/persistence-context , has own first level cache being tracked transaction. actually "dirty-read" property of database transaction , not hibernate in general. when 1 transaction reads changes

Error smtplib in python -

i've python script, run on raspeberry pi monitoring server room , periodically send me e-mail , make other stuff. first time script running send notification , works fine, wait time (5 or 30 minutues) depending if alarm triggered, i've write loop wait. when loop finish, script make call of function sending e-mail , python return error. me ? test on debian 7.7.0 box , i've same error. below sample script , error. in advance. dom. file "/usr/lib/python2.7/smtplib.py", line 361, in getreply raise smtpserverdisconnected("connection unexpectedly closed") smtplib.smtpserverdisconnected: connection unexpectedly closed # import time import sleep import time import smtplib import sys import string smtp_server = "10.0.0.4" # mail server address mail_from = "server@domain.com" mail_to = "user@gmail.com" mail_subj = "server room notify" server = smtplib.smtp(smtp_server) valore = 24 # value funtion def sendalertema

java - Eclipse - simulate full disk when running server -

i have small application doesn't take lots of space (the application lot of disk writing, data accumulates) , need know happens when disk full , application still trying write disk; whether parts fail or entire thing. i'm running tomcat within eclipse , know if there way limit disk space allowed server created in eclipse. ideas? you can create small ram drive, can used physical drive exists entirely in ram. has added benefit fast , don't have delete test files afterwards, contents gone after ram drive closed. as how create ram drive, depends on operating system. in linux, can use tmpfs (taken https://unix.stackexchange.com/questions/66329/creating-a-ram-disk-on-linux ): mount -o size=16g -t tmpfs none /mnt/tmpfs edit: in windows, isn't shipped system need install additional software. list of can found @ http://en.wikipedia.org/wiki/list_of_ram_drive_software .

php - How Action helper communicate with view helper -

i create action helper file path c:\xampp\htdocs\ecom\application\controllers\helpers file name : inputdata.php class zend_controller_action_helper_inputdata extends zend_controller_action_helper_abstract { function inputdata() { return $this; } function fetch_db_value($var) { if(get_magic_quotes_gpc()==0) { return is_array($var) ? array_map(array($this,'fetch_db_value'), $var) : nl2br(stripslashes(trim($var))); }else { return is_array($var) ? array_map(array($this,'fetch_db_value'), $var) : nl2br(trim($var)); } } } i calling function on controller giving output proper : $dbdata=$this->_helper->inputdata->fetch_db_value($dbdata); i have view helper, path c:\xampp\htdocs\ecom\application\views\helpers file name : comman.php class zend_view_helper_comman { public function displayproducts($res){ # res array

java - what does cache means in POST and GET -

i have seen that 1 of main difference between post , post not cached cached. could explain me mean "cache"? also, if use post or server sends me response. there difference? in of cases, have request data , response, not it? thanks get supposed return same result server , not change things @ server side , hence idempotent. whereas post means can modify @ server(make entry in db, delete etc) , hence not idempotent. and regards caching data in has been addressed here in nice manner. http://www.ebaytechblog.com/2012/08/20/caching-http-post-requests-and-responses/#.vgy9ovmueeq

c++ - openMP bad performance with false sharing -

i know exists thread openmp performance but here example simple c code: int mafunc(size_t szglobalworksize) { int igid = 0; float *pfresult = (float *)calloc(szglobalworksize * 100, sizeof(float)); float fvalue = 0.5f; struct timeval tim; gettimeofday(&tim, null); double tlaunch1=tim.tv_sec+(tim.tv_usec/1000000.0); #pragma omp parallel (igid = 0; igid < (int)szglobalworksize * 100; igid++) { pfresult[igid] = fvalue; // printf("element %d traité par le thread %d \n",igid,omp_get_thread_num()); } gettimeofday(&tim, null); double tlaunch2=tim.tv_sec+(tim.tv_usec/1000000.0); printf("%.6lf time omp\n", tlaunch2-tlaunch1); } timing of example increases when use openmp 0.015s without openmp against 0.045 sec openmp (szglobalworksize = 131072) i use line of gcc: gcc -march=native -fopenmp -o3 mycode.c -lm gcc (gcc) 4.8.

Create Virtual Machine on Azure with Java SDK -

i need create virtual machine azure java sdk. integrated maven dependencies project. need simple tutorial. can me? thanks recently azure has rolled out [java api (1.0.0) ][1]as stable release. follow 1.0.0 sdk in creating virtual machine. 1. create azure authentication file credentials subscription=<enter_subscription> client=<enter_client> key=<enter_key> tenant=<enter_tenant> managementuri=https\://management.core.windows.net/ baseurl=https\://management.azure.com/ authurl=https\://login.windows.net/ graphurl=https\://graph.windows.net/ 2. azure client perform operation in azure `final file credfile = new file("/users/risanand/cliqr.azureauth"); azure azure = azure.configure() .withloglevel(loglevel.basic) .authenticate(credfile) .withdefaultsubscription();` 3. create virtual machine `virtualmachine windowsvm = azure.virtualmachines().define("vmname") .withregion("regionname") .withnewresource

c# - Performance issue when launching WPF application -

i have complex wpf application using lot of resources shared resource dictionary. first window initialized takes 8 seconds initialize. performance issue less on ssd disk drives still requires 2 seconds. i tried use visual studio profiler , shows big expense of time on initializecomponent(); of windows needs displayed. i believe related resource dictionary used can't replace because need , because windows , wpf elements using staticresource references. i tried optimize launch as possible. created many background threads didn't helped much. whenever window needs displayed must attached on ui thread under same dispatcher. makes big performance issue , ui , progress bar left on screen blocked. so summarize. point when showdialog called until window displayed takes 8 seconds. visible on first window. other window opened after displayed quickly. now asking firstly happens in background , why delay big , second can done increase startup speed. i didn't mentioned t

magento - Hide out of stock products only in search result pages -

we can hide out of stock products in categories , catalog search through : system > configuration > catalog > inventory > display out of stock products yet, how can hide products in search results ? you override _getsearchableproducts function in class mage_catalogsearch_model_resource_fulltext searches in-stock products. file modify: app/code/core/mage/catalogsearch/model/resource/fulltext.php /** * retrieve searchable products per store * * @param int $storeid * @param array $staticfields * @param array|int $productids * @param int $lastproductid * @param int $limit * @return array */ protected function _getsearchableproducts($storeid, array $staticfields, $productids = null, $lastproductid = 0, $limit = 100) { ... ->join( array('stock_status' => $this->gettable('cataloginventory/stock_status')), $writeadapter->quoteinto( 'stock_status.product_id=e.entity_id , stock_

jquery - Get JSON and save as Variabel depending on ID -

i got following json example. if enter url: http://url.de#1234 , content of kunde -> 1234 written variables. how can done? json: { "kunde": { "1234": [{ "gender": "male", "firstname": "karl-heinz", }], "3214": [{ "gender": "female", "firstname": "annette-heinz", }], "5845": [{ "gender": "male", "firstname": "anton-heinz", }] } } jsfiddle js , html: http://jsfiddle.net/7atle66g/ update this work, not hash grabber , inserting json function. why not?? var url = window.location.href, idx = url.indexof("#"); var hash = idx != -1 ? url.substring(idx+1) : ""; var json_url = "http://localhost/test/beispiel.json"; $.getjson(json_url, function (data) { var t = data.kunde[hash][0]; alert(t.gender +

Twilio how to get rid of prompt to accept call? -

when phone recieves outbound call twilio application caller hears "you recieving call number xxx-xxx-xxxx press key accept. how can rid of have call recieved average phone call. i assuming using openvbx, description in question. turn off prompt hearing, can go dial applet have configured , turn off whisper option. just careful, option overcoming problem might encounter, if device calling example mobile device , switches on voice mail. whisper option when enabled of course not pass call device, whisper option required human intervention pressing button on keypad accept call. if not problem you, can turn whisper off. hope helps.

algorithm - Graph is connected or not ! in c language for ford fulkersion -

Image
// created part of ford fulkersion algorithm #include<stdio.h> #include<conio.h> void main() { int v,i,e,ch[20],sv[20],count=0,s,j; clrscr(); printf("enter no of vertices :"); scanf("%d",&v); for(i=1;i<=v;i++) { printf("enter vertices %d",i); scanf("%d",&sv[i]); } printf("enter starting node : "); scanf("%d",&s); //problem in below loop(logic not working ) if 1 have solution please ! for(i=s;i<=v-1;i++) { for(j=i+1;j<=v;j++) { printf("conn betn %d , %d",i,j); scanf("%d",&ch[i]); if(ch[i]!=1) { break; } else if(ch[i]==1) { count++; } } } //---------------------------------------------------------- if(count>=v) { printf("graph connect

objective c - iOS Crash : libswiftAssetsLibrary.dylib not loaded -

when tried run app on simulator, run fine. when try run on device (iphone 6, ios 8.1), crashes instantly. it happens on macmini, , not on macbook pro. both running yosemite xcode 6.1. here log : exception type: exc_breakpoint (sigtrap) exception codes: 0x0000000000000001, 0x00000000e7ffdefe triggered thread: 0 dyld error message: library not loaded: @rpath/libswiftassetslibrary.dylib referenced from: /private/var/mobile/containers/bundle/application/03823de6-b2fd-4a2d-b03f-3770d433cbca/lima.app/lima reason: no suitable image found. did find: /private/var/mobile/containers/bundle/application/03823de6-b2fd-4a2d-b03f-3770d433cbca/lima.app/frameworks/libswiftassetslibrary.dylib: mmap() error 1 @ address=0x00871000, size=0x00004000 segment=__text in segment::map() mapping /private/var/mobile/containers/bundle/application/03823de6-b2fd-4a2d-b03f-3770d433cbca/lima.app/frameworks/libswiftassetslibrary.dylib dyld version: 353.5 what tried , doesn't work : changi

Windows Phone 8 Emulator on Azure VM -

i've done lot of research , it's apparent windows 8 emulator cannot run inside azure vm. i've seen the answers provided in similar questions on so, haven't seen propose these solutions it's worth shot. in 1 article read, guy claimed able use usb pass-through connect physical phone virtual machine haven't been able work. i'm starting suspect using local vm , not connecting via rdp azure vm. if has more information whether should work, please pass on. i have 2 ideas workarounds, i'm not sure if they'd work i'm looking input in case i'm wasting time. 1) emulator vm run standalone device in azure domain. don't think possible without microsoft. haven't looked far, doesn't appear can upload own vm azure. assumption ms need provide emulator vm image in gallery. 2) i'm more optimistic one, once again, i'm making lot of assumptions based on little knowledge. have seen that's it's possible connect azure v

string - How to convert fileData from str to file type in Python? -

i've got file data read api base64 , converted regular file data using following: base64filedata = attachmentobj.data['data'] filedata = base64.urlsafe_b64decode(base64filedata.encode('utf-8')) print type(filedata) # prints out <type 'str'> since need file in binary further process it, can store , read out follows: print type(filedata) # prints out <type 'str'> open('thefile.pdf', 'w') f: f.write(filedata) open('thefile.pdf', 'rb') f: print type(f) # prints out <type 'file'>, need. this works, seeing there no need store file, seems 1 of worst pieces of code i've ever seen. does know how can convert initial filedata type 'file' without storing , reading out? tips welcome! check out stringio / cstringio modules . present file interface existing buffer (string) in memory. let pass data library without writing temp file. for example: import string

Perl - split command with regex - split numeric and strings -

my data follows: 20110627 abc dbe efg 217722 1425 1767 0.654504367955466 0.811585416264778 -0.157081048309312 i trying split in such way keep numeric values in 1 cell, , strings in 1 cell. thus, want "20110627" in 1 cell, "abc dbe efg" in another, "0.811585416264778" in another, "-0.157081048309312" in another, etc. i have following split command in perl regex my @fld = split(/[\d+][\s][\w+]/, $_); but doesn't seem want.. can tell me regex use? in advance edit : following vks suggestion, changed regex little bit rid of whitespace, take account string might have commas (,) or slash (/) or dash (-) negative sign (-) seems taken separate token in numbers: (-?\d+(\.\d+)?)|([\/?,?\.?\-?a-za-z\/ ]+) 20110627 b c 217722 1425 1767 0.654504367955466 0.811585416264778 -0.157081048309312 19950725 c 16458 63 91 0.38279256288735 0.552922590837283 -0.170130027949933 19980323 g c /de/ 20130516 - e, inc. 33019 398 197 1.2053666071